From bf15c19167a870f5fb48e0bbf66ca1d489a02e45 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Sun, 17 Apr 2016 19:01:38 +1200 Subject: [PATCH] Test fixes - output adjustment (#8155) * test fixes * Comment fixes --- CRM/Price/Form/Field.php | 5 +---- CRM/Price/Page/Field.php | 4 ---- tests/phpunit/CRM/Group/Page/AjaxTest.php | 17 +++++++++++------ tests/phpunit/CiviTest/CiviUnitTestCase.php | 1 + 4 files changed, 13 insertions(+), 14 deletions(-) diff --git a/CRM/Price/Form/Field.php b/CRM/Price/Form/Field.php index 1941677e19..5c50b9ff72 100644 --- a/CRM/Price/Form/Field.php +++ b/CRM/Price/Form/Field.php @@ -29,8 +29,6 @@ * * @package CRM * @copyright CiviCRM LLC (c) 2004-2016 - * $Id$ - * */ /** @@ -91,8 +89,7 @@ class CRM_Price_Form_Field extends CRM_Core_Form { } /** - * Set default values for the form. Note that in edit/view mode - * the default values are retrieved from the database + * Set default values for the form. * * @return array * array of default values diff --git a/CRM/Price/Page/Field.php b/CRM/Price/Page/Field.php index f612262532..9ebf7ebd21 100644 --- a/CRM/Price/Page/Field.php +++ b/CRM/Price/Page/Field.php @@ -110,8 +110,6 @@ class CRM_Price_Page_Field extends CRM_Core_Page { /** * Browse all price set fields. - * - * @return void */ public function browse() { $resourceManager = CRM_Core_Resources::singleton(); @@ -218,8 +216,6 @@ class CRM_Price_Page_Field extends CRM_Core_Page { * * @param string $action * The action to be invoked. - * - * @return void */ public function edit($action) { // create a simple controller for editing price data diff --git a/tests/phpunit/CRM/Group/Page/AjaxTest.php b/tests/phpunit/CRM/Group/Page/AjaxTest.php index 3d660632c5..7db267319b 100644 --- a/tests/phpunit/CRM/Group/Page/AjaxTest.php +++ b/tests/phpunit/CRM/Group/Page/AjaxTest.php @@ -63,8 +63,7 @@ class CRM_Group_Page_AjaxTest extends CiviUnitTestCase { * @param $permission */ public function setPermissionAndRequest($permission) { - CRM_Core_Config::singleton()->userPermissionClass->permissions = (array) $permission; - CRM_Contact_BAO_Group::getPermissionClause(TRUE); + $this->setPermissions((array) $permission); global $_REQUEST; $_REQUEST = $this->_params; } @@ -103,16 +102,22 @@ class CRM_Group_Page_AjaxTest extends CiviUnitTestCase { $params = $this->_params; $groups = CRM_Contact_BAO_Group::getGroupListSelector($params); $this->assertEquals(2, $groups['recordsTotal']); - $this->assertEquals('Contacts', $groups['data'][0]['links']); - $this->assertEquals('Contacts', $groups['data'][1]['links']); + $this->assertEquals('Contacts', $groups['data'][0]['links']); + $this->assertEquals('Contacts', $groups['data'][1]['links']); // as per changes made in PR-6822 $this->setPermissionAndRequest(array('view all contacts', 'edit groups')); $params = $this->_params; $groups = CRM_Contact_BAO_Group::getGroupListSelector($params); $this->assertEquals(2, $groups['recordsTotal']); - $this->assertEquals('ContactsSettingsmore', $groups['data'][0]['links']); - $this->assertEquals('ContactsSettingsmore', $groups['data'][1]['links']); + $this->assertEquals('ContactsSettingsmore', $groups['data'][0]['links']); + $this->assertEquals('ContactsSettingsmore', $groups['data'][1]['links']); } /** diff --git a/tests/phpunit/CiviTest/CiviUnitTestCase.php b/tests/phpunit/CiviTest/CiviUnitTestCase.php index 83f1bf0378..c5b2142e9b 100644 --- a/tests/phpunit/CiviTest/CiviUnitTestCase.php +++ b/tests/phpunit/CiviTest/CiviUnitTestCase.php @@ -3458,6 +3458,7 @@ AND ( TABLE_NAME LIKE 'civicrm_value_%' ) protected function setPermissions($permissions) { CRM_Core_Config::singleton()->userPermissionClass->permissions = $permissions; $this->flushFinancialTypeStatics(); + CRM_Contact_BAO_Group::getPermissionClause(TRUE); } } -- 2.25.1