From 1bf008829b147b8000edd7908f0110b322a4cd2f Mon Sep 17 00:00:00 2001 From: Pradeep Nayak Date: Thu, 26 Jul 2018 12:05:45 +0100 Subject: [PATCH] Added code to throw exception on getvalue api call --- Civi/Test/Api3TestTrait.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Civi/Test/Api3TestTrait.php b/Civi/Test/Api3TestTrait.php index 1efcd13ce6..2a10abf7e7 100644 --- a/Civi/Test/Api3TestTrait.php +++ b/Civi/Test/Api3TestTrait.php @@ -235,6 +235,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 -- 2.25.1