Skip to content

Commit

Permalink
Avoid duplicate activity types
Browse files Browse the repository at this point in the history
  • Loading branch information
demeritcowboy committed Nov 15, 2019
1 parent 1c489cf commit e11582a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/phpunit/CiviTest/CiviCaseTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ public function setUp() {
'Income and benefits stabilization' => 'Income and benefits stabilization',
);
foreach ($optionValues as $name => $label) {
$activityTypes = $this->callAPISuccess('option_value', 'Create', array(
'option_group_id' => 2,
$activityTypes = CRM_Core_BAO_OptionValue::ensureOptionValueExists([
'option_group_id' => 'activity_type',
'name' => $name,
'label' => $label,
'component_id' => 7,
));
'component_id' => 'CiviCase',
]);
// store for cleanup
$this->optionValues[] = $activityTypes['id'];
}
Expand Down

0 comments on commit e11582a

Please sign in to comment.