CRM-13072 fix non return on civicrm_api3 wrapper - how did that sneak in?
authoreileen <eileen@fuzion.co.nz>
Sat, 27 Jul 2013 22:30:37 +0000 (10:30 +1200)
committereileen <eileen@fuzion.co.nz>
Sat, 27 Jul 2013 22:30:37 +0000 (10:30 +1200)
api/api.php
tests/phpunit/api/v3/APITest.php

index 104d8cb9ff2f13644b8bfc1177a3ab835bb2253f..5062422df6d50280a1d51bf268309bf4fec9667c 100644 (file)
@@ -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;
 }
 
 /**
index 44ae5690b28df0e8b16b172b6700bdbb7f19677d..05eda06641f2c21498d43dcde479dab0d666860e 100644 (file)
@@ -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);
   }