X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=Civi%2FTest%2FApi3TestTrait.php;h=96e41b9d7a73d7a04a5e1bd06eb837586437c704;hb=cb4e7d31e6c400ba42f6b2dc1250320bc9a73b17;hp=1efcd13ce693246853128e091e7ee156058b8b78;hpb=fd87b71e4e241742a2117bf3157d4cae9336872b;p=civicrm-core.git diff --git a/Civi/Test/Api3TestTrait.php b/Civi/Test/Api3TestTrait.php index 1efcd13ce6..96e41b9d7a 100644 --- a/Civi/Test/Api3TestTrait.php +++ b/Civi/Test/Api3TestTrait.php @@ -202,7 +202,12 @@ trait Api3TestTrait { ); $result = $this->civicrm_api($entity, 'getsingle', $params); if (!is_array($result) || !empty($result['is_error']) || isset($result['values'])) { - throw new \Exception('Invalid getsingle result' . print_r($result, TRUE)); + $unfilteredResult = $this->civicrm_api($entity, 'get', $params); + throw new \Exception( + 'Invalid getsingle result' . print_r($result, TRUE) + . "\n entity: $entity . \n params \n " . print_r($params, TRUE) + . "\n entities retrieved with blank params \n" . print_r($unfilteredResult, TRUE) + ); } if ($checkAgainst) { // @todo - have gone with the fn that unsets id? should we check id? @@ -235,6 +240,9 @@ trait Api3TestTrait { 'debug' => 1, ); $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)); + } if ($type) { if ($type == 'integer') { // api seems to return integers as strings