From c4ac4df4c6be7da5f616cd97241e33c2ce405484 Mon Sep 17 00:00:00 2001 From: eileen Date: Sun, 28 Jul 2013 10:30:37 +1200 Subject: [PATCH] CRM-13072 fix non return on civicrm_api3 wrapper - how did that sneak in? --- api/api.php | 3 ++- tests/phpunit/api/v3/APITest.php | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/api/api.php b/api/api.php index 104d8cb9ff..5062422df6 100644 --- a/api/api.php +++ b/api/api.php @@ -245,12 +245,13 @@ function _civicrm_api_resolve($apiRequest) { * @return array * */ -function civicrm_api3($entity, $action, $params){ +function civicrm_api3($entity, $action, $params) { $params['version'] = 3; $result = civicrm_api($entity, $action, $params); if($result['is_error']){ throw new CiviCRM_API3_Exception($result['error_message'], CRM_Utils_Array::value('error_code', $result, 'undefined'), $result); } + return $result; } /** diff --git a/tests/phpunit/api/v3/APITest.php b/tests/phpunit/api/v3/APITest.php index 44ae5690b2..05eda06641 100644 --- a/tests/phpunit/api/v3/APITest.php +++ b/tests/phpunit/api/v3/APITest.php @@ -161,6 +161,7 @@ class api_v3_APITest extends CiviUnitTestCase { catch (CRM_Exception $e){ $this->fail("This should have been a success test"); } + $this->assertTrue(is_array($result)); $this->assertAPISuccess($result); } -- 2.25.1