From 9775f92674c63bc0b76e5433a67a7715c4733284 Mon Sep 17 00:00:00 2001 From: kurund Date: Thu, 13 Mar 2014 17:57:23 +0530 Subject: [PATCH] more test fixes --- CRM/Admin/Form/ScheduleReminders.php | 2 +- CRM/Core/SelectValues.php | 18 +++++++++++++++--- tests/phpunit/api/v3/CustomGroupTest.php | 3 ++- xml/schema/Core/ActionSchedule.xml | 9 +++------ xml/schema/Mailing/MailingJob.xml | 2 +- 5 files changed, 22 insertions(+), 12 deletions(-) diff --git a/CRM/Admin/Form/ScheduleReminders.php b/CRM/Admin/Form/ScheduleReminders.php index bf0f837f14..f047fc2641 100644 --- a/CRM/Admin/Form/ScheduleReminders.php +++ b/CRM/Admin/Form/ScheduleReminders.php @@ -126,7 +126,7 @@ class CRM_Admin_Form_ScheduleReminders extends CRM_Admin_Form { } //get the frequency units. - $this->_freqUnits = array('hour' => 'hour') + CRM_Core_OptionGroup::values('recur_frequency_units'); + $this->_freqUnits = CRM_Core_SelectValues::getScheduleReminderFrequencyUnits(); //pass the mapping ID in UPDATE mode $mappings = CRM_Core_BAO_ActionSchedule::getMapping($mappingID); diff --git a/CRM/Core/SelectValues.php b/CRM/Core/SelectValues.php index a84818b9fb..8c45192b3f 100644 --- a/CRM/Core/SelectValues.php +++ b/CRM/Core/SelectValues.php @@ -198,7 +198,7 @@ class CRM_Core_SelectValues { 'TextArea' => ts('Multi-line text box (textarea)'), 'Select' => ts('Drop-down (select list)'), 'Radio' => ts('Radio buttons'), - 'Checkbox' => ts('Checkbox(es)'), + 'CheckBox' => ts('Checkbox(es)'), 'Date' => ts('Select Date'), 'File' => ts('File'), 'StateProvince' => ts('Select State/Province'), @@ -257,7 +257,7 @@ class CRM_Core_SelectValues { $customGroupStyle = array( 'Tab' => ts('Tab'), 'Inline' => ts('Inline'), - 'Tab with table' => ts('Tab with table') + 'Tab with table' => ts('Tab with table'), ); } return $customGroupStyle; @@ -1051,7 +1051,7 @@ class CRM_Core_SelectValues { /** * Mailing Job Status */ - static function geMailingJobStatus() { + static function getMailingJobStatus() { static $mailingJobStatus = NULL; if (!$mailingJobStatus) { $mailingJobStatus = array( @@ -1066,5 +1066,17 @@ class CRM_Core_SelectValues { return $mailingJobStatus; } + /** + * Frequency unit for schedule reminders + */ + static function getScheduleReminderFrequencyUnits() { + static $scheduleReminderFrequencyUnits = NULL; + if (!$scheduleReminderFrequencyUnits) { + $scheduleReminderFrequencyUnits = array( + 'hour' => ts('hour')) + CRM_Core_OptionGroup::values('recur_frequency_units'); + } + + return $scheduleReminderFrequencyUnits; + } } diff --git a/tests/phpunit/api/v3/CustomGroupTest.php b/tests/phpunit/api/v3/CustomGroupTest.php index efa227b9d5..970d7dc266 100644 --- a/tests/phpunit/api/v3/CustomGroupTest.php +++ b/tests/phpunit/api/v3/CustomGroupTest.php @@ -174,13 +174,14 @@ class api_v3_CustomGroupTest extends CiviUnitTestCase { */ function testCustomGroupGetFields() { $params = array( - 'options' => array('get_options' => 'style'), + 'options' => array('get_options' => 'style'), ); $result = $this->callAPISuccess('custom_group', 'getfields', $params); $expected = array( 'Tab' => 'Tab', 'Inline' => 'Inline', + 'Tab with table' => 'Tab with table', ); $this->assertEquals($expected, $result['values']['style']['options']); } diff --git a/xml/schema/Core/ActionSchedule.xml b/xml/schema/Core/ActionSchedule.xml index 0afc6c27fb..8d2fa36eaa 100644 --- a/xml/schema/Core/ActionSchedule.xml +++ b/xml/schema/Core/ActionSchedule.xml @@ -72,8 +72,7 @@ 8 Time units for reminder. - recur_frequency_units - name + CRM_Core_SelectValues::getScheduleReminderFrequencyUnits 3.4 @@ -107,8 +106,7 @@ 8 Time units for repetition of reminder. - recur_frequency_units - name + CRM_Core_SelectValues::getScheduleReminderFrequencyUnits 3.4 @@ -127,8 +125,7 @@ 8 Time units till repetition of reminder. - recur_frequency_units - name + CRM_Core_SelectValues::getScheduleReminderFrequencyUnits 3.4 diff --git a/xml/schema/Mailing/MailingJob.xml b/xml/schema/Mailing/MailingJob.xml index 3fb29e4617..244efea68a 100644 --- a/xml/schema/Mailing/MailingJob.xml +++ b/xml/schema/Mailing/MailingJob.xml @@ -48,7 +48,7 @@ 12 The state of this job - CRM_Core_SelectValues::geMailingJobStatus + CRM_Core_SelectValues::getMailingJobStatus Select -- 2.25.1