From e11582abf0899f519143bb34fd70356d8f5bc35b Mon Sep 17 00:00:00 2001 From: DemeritCowboy Date: Thu, 14 Nov 2019 22:45:00 -0500 Subject: [PATCH] Avoid duplicate activity types --- tests/phpunit/CiviTest/CiviCaseTestCase.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/phpunit/CiviTest/CiviCaseTestCase.php b/tests/phpunit/CiviTest/CiviCaseTestCase.php index e49789d59b11..5e6c027d5d36 100644 --- a/tests/phpunit/CiviTest/CiviCaseTestCase.php +++ b/tests/phpunit/CiviTest/CiviCaseTestCase.php @@ -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']; }