X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=Civi%2FTest%2FApi3TestTrait.php;h=1c99c0490b42d3e61f84014020a4704a7d43216e;hb=ff93f0ab952152f0eb2edc6c32b5ee156724005e;hp=3b50e4862fa250a70a04156e93c32929ec5c03ae;hpb=d216d811365607b8c185a661de01b660566d66df;p=civicrm-core.git diff --git a/Civi/Test/Api3TestTrait.php b/Civi/Test/Api3TestTrait.php index 3b50e4862f..1c99c0490b 100644 --- a/Civi/Test/Api3TestTrait.php +++ b/Civi/Test/Api3TestTrait.php @@ -249,6 +249,7 @@ trait Api3TestTrait { * - object * * @return array|int + * @throws \CRM_Core_Exception */ public function callAPISuccessGetValue($entity, $params, $type = NULL) { $params += [ @@ -257,10 +258,10 @@ trait Api3TestTrait { ]; $result = $this->civicrm_api($entity, 'getvalue', $params); if (is_array($result) && (!empty($result['is_error']) || isset($result['values']))) { - throw new \Exception('Invalid getvalue result' . print_r($result, TRUE)); + throw new \CRM_Core_Exception('Invalid getvalue result' . print_r($result, TRUE)); } if ($type) { - if ($type == 'integer') { + if ($type === 'integer') { // api seems to return integers as strings $this->assertTrue(is_numeric($result), "expected a numeric value but got " . print_r($result, 1)); }