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,
);
$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',
$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'];
$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));
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);
-- /*******************************************************
-- *