From: Seamus Lee Date: Thu, 23 Feb 2017 06:50:57 +0000 (+1100) Subject: CRM-20144 (NFC) Update tests and example X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=bd6de8019bffa9774b44067ea949d4829e61aea0;p=civicrm-core.git CRM-20144 (NFC) Update tests and example --- diff --git a/api/v3/examples/Contact/GroupFilterUsingContactAPI.php b/api/v3/examples/Contact/GroupFilterUsingContactAPI.php index 4c1cf9865d..19bfee8c23 100644 --- a/api/v3/examples/Contact/GroupFilterUsingContactAPI.php +++ b/api/v3/examples/Contact/GroupFilterUsingContactAPI.php @@ -9,9 +9,11 @@ */ function contact_get_example() { $params = array( - 'filter.group_id' => array( - '0' => 1, - '1' => 26, + 'group' => array( + 'IN' => array( + '0' => 1, + '1' => 26, + ), ), 'contact_type' => 'Individual', ); diff --git a/tests/phpunit/api/v3/ContactTest.php b/tests/phpunit/api/v3/ContactTest.php index d3897ba2cd..d195d3f2fd 100644 --- a/tests/phpunit/api/v3/ContactTest.php +++ b/tests/phpunit/api/v3/ContactTest.php @@ -996,33 +996,33 @@ class api_v3_ContactTest extends CiviUnitTestCase { $this->callAPISuccess('contact', 'create', $params); // testing as integer $params = array( - 'filter.group_id' => $groupId, + 'group' => $groupId, 'contact_type' => 'Individual', ); $result = $this->callAPIAndDocument('contact', 'get', $params, __FUNCTION__, __FILE__, $description, $subFile); $this->assertEquals(1, $result['count']); // group 26 doesn't exist, but we can still search contacts in it. $params = array( - 'filter.group_id' => 26, + 'group' => 26, 'contact_type' => 'Individual', ); $this->callAPISuccess('contact', 'get', $params); // testing as string $params = array( - 'filter.group_id' => "$groupId, 26", + 'group' => array($groupId, 26), 'contact_type' => 'Individual', ); $result = $this->callAPIAndDocument('contact', 'get', $params, __FUNCTION__, __FILE__, $description, $subFile); $this->assertEquals(1, $result['count']); $params = array( - 'filter.group_id' => "26,27", + 'group' => array(26, 27), 'contact_type' => 'Individual', ); $this->callAPISuccess('contact', 'get', $params); // testing as string $params = array( - 'filter.group_id' => array($groupId, 26), + 'group' => array('IN' => array($groupId, 26)), 'contact_type' => 'Individual', ); $result = $this->callAPIAndDocument('contact', 'get', $params, __FUNCTION__, __FILE__, $description, $subFile); @@ -1030,12 +1030,12 @@ class api_v3_ContactTest extends CiviUnitTestCase { //test in conjunction with other criteria $params = array( - 'filter.group_id' => array($groupId, 26), + 'group' => array($groupId, 26), 'contact_type' => 'Organization', ); $this->callAPISuccess('contact', 'get', $params); $params = array( - 'filter.group_id' => array(26, 27), + 'group' => array(26, 27), 'contact_type' => 'Individual', ); $result = $this->callAPISuccess('contact', 'get', $params);