From: Tim Otten Date: Mon, 14 Jul 2014 03:06:42 +0000 (-0700) Subject: CiviCase - Consistently use name "housing_support" and "adult_day_care_referral" X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=82de141deb749ce6b455a33f5194f1e3f3900db6;p=civicrm-core.git CiviCase - Consistently use name "housing_support" and "adult_day_care_referral" See: * http://forum.civicrm.org/index.php/topic,33512.0.html * CRM-14798 --- diff --git a/CRM/Case/xml/configuration.sample/HousingSupport.xml b/CRM/Case/xml/configuration.sample/housing_support.xml similarity index 100% rename from CRM/Case/xml/configuration.sample/HousingSupport.xml rename to CRM/Case/xml/configuration.sample/housing_support.xml diff --git a/tests/phpunit/Civi/CCase/SequenceListenerTest.php b/tests/phpunit/Civi/CCase/SequenceListenerTest.php index feb2927354..36f78f866c 100644 --- a/tests/phpunit/Civi/CCase/SequenceListenerTest.php +++ b/tests/phpunit/Civi/CCase/SequenceListenerTest.php @@ -8,7 +8,7 @@ class SequenceListenerTest extends \CiviCaseTestCase { public function setUp() { parent::setUp(); $this->_params = array( - 'case_type' => 'Housing Support', // FIXME: $this->caseType, + 'case_type' => $this->caseType, 'subject' => 'Test case', 'contact_id' => 17, ); diff --git a/tests/phpunit/CiviTest/CiviCaseTestCase.php b/tests/phpunit/CiviTest/CiviCaseTestCase.php index 8f80ebc335..eb28b6efc1 100644 --- a/tests/phpunit/CiviTest/CiviCaseTestCase.php +++ b/tests/phpunit/CiviTest/CiviCaseTestCase.php @@ -81,8 +81,9 @@ class CiviCaseTestCase extends CiviUnitTestCase { $this->optionValues[] = $activityTypes['id']; } - // TODO Our data seems inconsistent on whether name is "HousingSupport" or "housing_support" - $this->caseType = 'HousingSupport'; + // We used to be inconsistent about "HousingSupport" vs "housing_support". + // Now, the rule is simply: use the "name" from "civicrm_case_type.name". + $this->caseType = 'housing_support'; $this->caseTypeId = 1; $this->tablesToTruncate = array( 'civicrm_activity', diff --git a/tests/phpunit/api/v3/CaseTest.php b/tests/phpunit/api/v3/CaseTest.php index 4d9c6b0035..5e56500a1a 100644 --- a/tests/phpunit/api/v3/CaseTest.php +++ b/tests/phpunit/api/v3/CaseTest.php @@ -97,7 +97,7 @@ class api_v3_CaseTest extends CiviCaseTestCase { $params = $this->_params; // Test using label instead of value unset($params['case_type_id']); - $params['case_type'] = 'housing_support'; + $params['case_type'] = $this->caseType; $result = $this->callAPISuccess('case', 'create', $params); $id = $result['id']; @@ -116,7 +116,7 @@ class api_v3_CaseTest extends CiviCaseTestCase { $params = $this->_params; // Test using name instead of value unset($params['case_type_id']); - $params['case_type'] = 'housing_support'; + $params['case_type'] = $this->caseType; $result = $this->callAPISuccess('case', 'create', $params); $id = $result['id']; $result = $this->callAPISuccess('case', 'get', array('id' => $id)); diff --git a/tests/phpunit/custom_directories/templates/CRM/Case/xml/configuration/HousingSupport.xml b/tests/phpunit/custom_directories/templates/CRM/Case/xml/configuration/housing_support.xml similarity index 100% rename from tests/phpunit/custom_directories/templates/CRM/Case/xml/configuration/HousingSupport.xml rename to tests/phpunit/custom_directories/templates/CRM/Case/xml/configuration/housing_support.xml diff --git a/xml/templates/case_sample.tpl b/xml/templates/case_sample.tpl index ec6997a92d..e069bbdbf4 100644 --- a/xml/templates/case_sample.tpl +++ b/xml/templates/case_sample.tpl @@ -15,8 +15,8 @@ SELECT @caseCompId := id FROM `civicrm_component` where `name` like 'CiviCase'; SELECT @max_wt := COALESCE ( max(weight), 0 ) from civicrm_case_type; INSERT IGNORE INTO `civicrm_case_type` ( `title`, `name`, `description`, `weight`, `is_reserved`, `is_active`) VALUES - ('{ts}Housing Support{/ts}', 'HousingSupport', '{ts}Help homeless individuals obtain temporary and long-term housing{/ts}', @max_wt + 1, 0, 1), - ('{ts}Adult Day Care Referral{/ts}', 'AdultDayCareReferral', '{ts}Arranging adult day care for senior individuals{/ts}', @max_wt + 2, 0, 1); + ('{ts}Housing Support{/ts}', 'housing_support', '{ts}Help homeless individuals obtain temporary and long-term housing{/ts}', @max_wt + 1, 0, 1), + ('{ts}Adult Day Care Referral{/ts}', 'adult_day_care_referral', '{ts}Arranging adult day care for senior individuals{/ts}', @max_wt + 2, 0, 1); -- /******************************************************* -- *