From d449ee2858e5b3e13702c24e8dfbbe0461fc4190 Mon Sep 17 00:00:00 2001 From: Joseph Lacey Date: Thu, 25 Feb 2016 17:40:31 -0500 Subject: [PATCH] Changing setup for Group Page AJAX PHPUnit tests. --- tests/phpunit/CRM/Group/Page/AjaxTest.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/tests/phpunit/CRM/Group/Page/AjaxTest.php b/tests/phpunit/CRM/Group/Page/AjaxTest.php index 8daab142e0..c5069e9f7e 100644 --- a/tests/phpunit/CRM/Group/Page/AjaxTest.php +++ b/tests/phpunit/CRM/Group/Page/AjaxTest.php @@ -27,12 +27,12 @@ class CRM_Group_Page_AjaxTest extends CiviUnitTestCase { public function setUp() { parent::setUp(); $this->_params = array( - 'sEcho' => '1', 'page' => 1, 'rp' => 50, 'offset' => 0, 'rowCount' => 50, 'sort' => NULL, + 'parentsOnly' => FALSE, 'is_unit_test' => TRUE, ); $this->hookClass = CRM_Utils_Hook::singleton(); @@ -228,7 +228,7 @@ class CRM_Group_Page_AjaxTest extends CiviUnitTestCase { $this->assertEquals('1 = 0', $permissionClause); $params = $this->_params; $groups = CRM_Contact_BAO_Group::getGroupListSelector($params); - $this->assertEquals(0, $groups['data']); + $this->assertEquals(0, count($groups['data'])); $this->assertEquals(0, $groups['recordsTotal'], 'Total returned should be accurate based on permissions'); } @@ -240,7 +240,7 @@ class CRM_Group_Page_AjaxTest extends CiviUnitTestCase { $this->setPermissionAndRequest('access CiviCRM'); $params = $this->_params; $groups = CRM_Contact_BAO_Group::getGroupListSelector($params); - $this->assertEquals(0, $groups['data']); + $this->assertEquals(0, count($groups['data'])); $this->assertEquals(0, $groups['recordsTotal'], 'Total returned should be accurate based on permissions'); } @@ -252,7 +252,7 @@ class CRM_Group_Page_AjaxTest extends CiviUnitTestCase { $this->setPermissionAndRequest('access CiviCRM'); $params = $this->_params; $groups = CRM_Contact_BAO_Group::getGroupListSelector($params); - $this->assertEquals(0, $groups['data']); + $this->assertEquals(0, count($groups['data'])); $this->assertEquals(0, $groups['recordsTotal'], 'Total returned should be accurate based on permissions'); } @@ -264,7 +264,7 @@ class CRM_Group_Page_AjaxTest extends CiviUnitTestCase { $this->setPermissionAndRequest('access CiviCRM'); $params = $this->_params; $groups = CRM_Contact_BAO_Group::getGroupListSelector($params); - $this->assertEquals(0, $groups['data']); + $this->assertEquals(0, count($groups['data'])); $this->assertEquals(0, $groups['recordsTotal'], 'Total returned should be accurate based on permissions'); } @@ -276,7 +276,7 @@ class CRM_Group_Page_AjaxTest extends CiviUnitTestCase { $this->setPermissionAndRequest('access CiviCRM'); $params = $this->_params; $groups = CRM_Contact_BAO_Group::getGroupListSelector($params); - $this->assertEquals(0, $groups['data']); + $this->assertEquals(0, count($groups['data'])); $this->assertEquals(0, $groups['recordsTotal'], 'Total returned should be accurate based on permissions'); } @@ -288,7 +288,7 @@ class CRM_Group_Page_AjaxTest extends CiviUnitTestCase { $this->setPermissionAndRequest('access CiviCRM'); $params = $this->_params; $groups = CRM_Contact_BAO_Group::getGroupListSelector($params); - $this->assertEquals(0, $groups['data']); + $this->assertEquals(0, count($groups['data'])); $this->assertEquals(0, $groups['recordsTotal'], 'Total returned should be accurate based on permissions'); } @@ -307,7 +307,7 @@ class CRM_Group_Page_AjaxTest extends CiviUnitTestCase { $this->setupACL(); $params = $this->_params; $groups = CRM_Contact_BAO_Group::getGroupListSelector($params); - $this->assertEquals(0, $groups['data'], 'Returned groups should exclude disabled by default'); + $this->assertEquals(0, count($groups['data']), 'Returned groups should exclude disabled by default'); $this->assertEquals(0, $groups['recordsTotal'], 'Total needs to be set correctly'); } @@ -352,7 +352,7 @@ class CRM_Group_Page_AjaxTest extends CiviUnitTestCase { $this->setupACL(); $params = $this->_params; $groups = CRM_Contact_BAO_Group::getGroupListSelector($params); - $this->assertEquals(0, $groups['data'], 'Returned groups should exclude disabled by default'); + $this->assertEquals(0, count($groups['data']), 'Returned groups should exclude disabled by default'); $this->assertEquals(0, $groups['recordsTotal'], 'Total needs to be set correctly'); } @@ -415,7 +415,7 @@ class CRM_Group_Page_AjaxTest extends CiviUnitTestCase { $this->setHookAndRequest('access CiviCRM', 'hook_civicrm_aclGroup'); $params = $this->_params; $groups = CRM_Contact_BAO_Group::getGroupListSelector($params); - $this->assertEquals(0, $groups['data'], 'Returned groups should exclude disabled by default'); + $this->assertEquals(0, count($groups['data']), 'Returned groups should exclude disabled by default'); $this->assertEquals(0, $groups['recordsTotal'], 'Total needs to be set correctly'); } -- 2.25.1