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 fbbb635 commit 244a19f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tests/phpunit/CiviTest/CiviCaseTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,14 @@ 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
// @todo is this ever used?
$this->optionValues[] = $activityTypes['id'];
}

Expand Down

0 comments on commit 244a19f

Please sign in to comment.