CRM-17795 - Api test fixes
authorColeman Watts <coleman@civicrm.org>
Thu, 7 Jan 2016 20:59:16 +0000 (15:59 -0500)
committerColeman Watts <coleman@civicrm.org>
Sat, 9 Jan 2016 01:51:02 +0000 (20:51 -0500)
Civi/API/SelectQuery.php
tests/phpunit/api/v3/MembershipTest.php

index fa5dec4351d14da242fc0a13f0dd502a2e48b5d7..d9879eeccb4f3f42933cf33b3b9e5793c9f14793 100644 (file)
@@ -189,7 +189,13 @@ class SelectQuery {
           }
         }
       }
-
+      // Ignore the "options" param if it is referring to api options and not a field in this entity
+      if (
+        $key === 'options' && is_array($value)
+        && !in_array(\CRM_Utils_Array::first(array_keys($value)), \CRM_Core_DAO::acceptedSQLOperators())
+      ) {
+        continue;
+      }
       $field = $this->getField($key);
       if ($field) {
         $key = $field['name'];
index 323750176ba7a9a09a4dac61ea2d458196b179e3..3f5176c08398669bbac87b6690369d44b00e528a 100644 (file)
@@ -609,7 +609,7 @@ class api_v3_MembershipTest extends CiviUnitTestCase {
     $this->contactMembershipCreate($this->_params);
     $result = $this->callAPISuccess('membership', 'get', array('return' => 'end_date'));
     foreach ($result['values'] as $membership) {
-      $this->assertEquals(array('end_date', 'membership_end_date', 'id'), array_keys($membership));
+      $this->assertEquals(array('end_date', 'id'), array_keys($membership));
     }
   }
   ///////////////// civicrm_membership_create methods