Test fixes - output adjustment (#8155)
authorEileen McNaughton <eileen@mcnaughty.com>
Sun, 17 Apr 2016 07:01:38 +0000 (19:01 +1200)
committerEileen McNaughton <eileen@mcnaughty.com>
Sun, 17 Apr 2016 07:01:38 +0000 (19:01 +1200)
* test fixes

* Comment fixes

CRM/Price/Form/Field.php
CRM/Price/Page/Field.php
tests/phpunit/CRM/Group/Page/AjaxTest.php
tests/phpunit/CiviTest/CiviUnitTestCase.php

index 1941677e19fcb0cd249d3fe9980c277f9079d2f5..5c50b9ff72a49d8f04d896da0ee3812028a0c013 100644 (file)
@@ -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
index f61226253260ae8eea3837540885642ed760c23e..9ebf7ebd210bb3cbc7776f9238f856c6e6f8ad41 100644 (file)
@@ -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
index 3d660632c5c19b9b056232bb8e2bba29523a207b..7db267319b72ee11dd10224c5457fc0a17bb6a10 100644 (file)
@@ -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('<span><a href="' . CIVICRM_UF_BASEURL . 'index.php?q=civicrm/group/search&amp;reset=1&amp;force=1&amp;context=smog&amp;gid=4" class="action-item crm-hover-button" title=\'Group Contacts\' >Contacts</a></span>', $groups['data'][0]['links']);
-    $this->assertEquals('<span><a href="' . CIVICRM_UF_BASEURL . 'index.php?q=civicrm/group/search&amp;reset=1&amp;force=1&amp;context=smog&amp;gid=2" class="action-item crm-hover-button" title=\'Group Contacts\' >Contacts</a></span>', $groups['data'][1]['links']);
+    $this->assertEquals('<span><a href="' . CIVICRM_UF_BASEURL . '/index.php?q=civicrm/group/search&amp;reset=1&amp;force=1&amp;context=smog&amp;gid=4" class="action-item crm-hover-button" title=\'Group Contacts\' >Contacts</a></span>', $groups['data'][0]['links']);
+    $this->assertEquals('<span><a href="' . CIVICRM_UF_BASEURL . '/index.php?q=civicrm/group/search&amp;reset=1&amp;force=1&amp;context=smog&amp;gid=2" class="action-item crm-hover-button" title=\'Group Contacts\' >Contacts</a></span>', $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('<span><a href="' . CIVICRM_UF_BASEURL . 'index.php?q=civicrm/group/search&amp;reset=1&amp;force=1&amp;context=smog&amp;gid=4" class="action-item crm-hover-button" title=\'Group Contacts\' >Contacts</a><a href="' . CIVICRM_UF_BASEURL . 'index.php?q=civicrm/group&amp;reset=1&amp;action=update&amp;id=4" class="action-item crm-hover-button" title=\'Edit Group\' >Settings</a></span><span class=\'btn-slide crm-hover-button\'>more<ul class=\'panel\'><li><a href="#" class="action-item crm-hover-button crm-enable-disable" title=\'Disable Group\' >Disable</a></li><li><a href="' . CIVICRM_UF_BASEURL . 'index.php?q=civicrm/group&amp;reset=1&amp;action=delete&amp;id=4" class="action-item crm-hover-button small-popup" title=\'Delete Group\' >Delete</a></li></ul></span>', $groups['data'][0]['links']);
-    $this->assertEquals('<span><a href="' . CIVICRM_UF_BASEURL . 'index.php?q=civicrm/group/search&amp;reset=1&amp;force=1&amp;context=smog&amp;gid=2" class="action-item crm-hover-button" title=\'Group Contacts\' >Contacts</a><a href="' . CIVICRM_UF_BASEURL . 'index.php?q=civicrm/group&amp;reset=1&amp;action=update&amp;id=2" class="action-item crm-hover-button" title=\'Edit Group\' >Settings</a></span><span class=\'btn-slide crm-hover-button\'>more<ul class=\'panel\'><li><a href="#" class="action-item crm-hover-button crm-enable-disable" title=\'Disable Group\' >Disable</a></li><li><a href="' . CIVICRM_UF_BASEURL . 'index.php?q=civicrm/group&amp;reset=1&amp;action=delete&amp;id=2" class="action-item crm-hover-button small-popup" title=\'Delete Group\' >Delete</a></li></ul></span>', $groups['data'][1]['links']);
+    $this->assertEquals('<span><a href="'
+      . CIVICRM_UF_BASEURL . '/index.php?q=civicrm/group/search&amp;reset=1&amp;force=1&amp;context=smog&amp;gid=4" class="action-item crm-hover-button" title=\'Group Contacts\' >Contacts</a><a href="'
+      . CIVICRM_UF_BASEURL . '/index.php?q=civicrm/group&amp;reset=1&amp;action=update&amp;id=4" class="action-item crm-hover-button" title=\'Edit Group\' >Settings</a></span><span class=\'btn-slide crm-hover-button\'>more<ul class=\'panel\'><li><a href="#" class="action-item crm-hover-button crm-enable-disable" title=\'Disable Group\' >Disable</a></li><li><a href="'
+      . CIVICRM_UF_BASEURL . '/index.php?q=civicrm/group&amp;reset=1&amp;action=delete&amp;id=4" class="action-item crm-hover-button small-popup" title=\'Delete Group\' >Delete</a></li></ul></span>', $groups['data'][0]['links']);
+    $this->assertEquals('<span><a href="'
+      . CIVICRM_UF_BASEURL . '/index.php?q=civicrm/group/search&amp;reset=1&amp;force=1&amp;context=smog&amp;gid=2" class="action-item crm-hover-button" title=\'Group Contacts\' >Contacts</a><a href="'
+      . CIVICRM_UF_BASEURL . '/index.php?q=civicrm/group&amp;reset=1&amp;action=update&amp;id=2" class="action-item crm-hover-button" title=\'Edit Group\' >Settings</a></span><span class=\'btn-slide crm-hover-button\'>more<ul class=\'panel\'><li><a href="#" class="action-item crm-hover-button crm-enable-disable" title=\'Disable Group\' >Disable</a></li><li><a href="'
+      . CIVICRM_UF_BASEURL . '/index.php?q=civicrm/group&amp;reset=1&amp;action=delete&amp;id=2" class="action-item crm-hover-button small-popup" title=\'Delete Group\' >Delete</a></li></ul></span>', $groups['data'][1]['links']);
   }
 
   /**
index 83f1bf0378017bcd26bf8def86d19f6d777e2ecc..c5b2142e9bfc2ff7d6f893d577d5ff7750514e9f 100644 (file)
@@ -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);
   }
 
 }