From 05ea397b0f5a2eb9ebba7d3cd507f8b14e645352 Mon Sep 17 00:00:00 2001 From: jitendrapurohit Date: Fri, 22 Jul 2016 17:03:40 +0530 Subject: [PATCH] set permission to pass group filter test --- tests/phpunit/CRM/Group/Page/AjaxTest.php | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/tests/phpunit/CRM/Group/Page/AjaxTest.php b/tests/phpunit/CRM/Group/Page/AjaxTest.php index 6596d136dd..aad0b9e984 100644 --- a/tests/phpunit/CRM/Group/Page/AjaxTest.php +++ b/tests/phpunit/CRM/Group/Page/AjaxTest.php @@ -84,25 +84,16 @@ class CRM_Group_Page_AjaxTest extends CiviUnitTestCase { * CRM-18528 - Retrieve groups with filter */ public function testGroupListWithFilter() { - global $_GET; - $_GET = array( - 'page' => 1, - 'rp' => 50, - 'offset' => 0, - 'rowCount' => 50, - 'sort' => NULL, - 'parentsOnly' => FALSE, - 'is_unit_test' => TRUE, - ); - $this->groupCreate(array('title' => 'Active Group', 'is_active' => 1, 'name' => 'active-group')); - $this->groupCreate(array('title' => 'Disabled Group', 'is_active' => 0, 'name' => 'disabled-group')); + $this->setPermissionAndRequest(array('view all contacts', 'edit groups')); + + $_GET = $this->_params; $obj = new CRM_Group_Page_AJAX(); //filter with title - $_GET['title'] = "Active Group"; + $_GET['title'] = "not-me-active"; $groups = $obj->getGroupList(); $this->assertEquals(1, $groups['recordsTotal']); - $this->assertEquals('Active Group', $groups['data'][0]['title']); + $this->assertEquals('not-me-active', $groups['data'][0]['title']); unset($_GET['title']); // check on status -- 2.25.1