Merge pull request #16766 from seamuslee001/5_23_2_release_notes
[civicrm-core.git] / tests / phpunit / CiviTest / CiviCaseTestCase.php
index e49789d59b113c7a7e0ce525df73a558979a0ae3..44b03ad3170fa4c522106aa72774b1270e9f8c99 100644 (file)
@@ -15,7 +15,8 @@
 class CiviCaseTestCase extends CiviUnitTestCase {
 
   /**
-   * @var string symbolic-name
+   * @var string
+   * Symbolic-name
    */
   protected $caseType;
 
@@ -38,22 +39,23 @@ class CiviCaseTestCase extends CiviUnitTestCase {
       'name' => 'case_status',
       'format.only_id' => 1,
     ));
-    $optionValues = array(
+    $optionValues = [
       'Medical evaluation' => 'Medical evaluation',
       'Mental health evaluation' => "Mental health evaluation",
       'Secure temporary housing' => 'Secure temporary housing',
       'Long-term housing plan' => 'Long-term housing plan',
       'ADC referral' => 'ADC referral',
       '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'];
     }