From cb4e7d31e6c400ba42f6b2dc1250320bc9a73b17 Mon Sep 17 00:00:00 2001 From: eileen Date: Sun, 17 Feb 2019 16:41:35 +1300 Subject: [PATCH] Add extra output info when getsingle fails as this seems to be common in intermittant fails --- Civi/Test/Api3TestTrait.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Civi/Test/Api3TestTrait.php b/Civi/Test/Api3TestTrait.php index 2a10abf7e7..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? -- 2.25.1