Fix for test suite leakage issue, ornery test
authoreileen <emcnaughton@wikimedia.org>
Tue, 19 Apr 2016 09:28:10 +0000 (21:28 +1200)
committereileen <emcnaughton@wikimedia.org>
Tue, 19 Apr 2016 09:28:10 +0000 (21:28 +1200)
CRM/Contact/BAO/Group.php
tests/phpunit/CRM/Group/Page/AjaxTest.php

index 84ca8871497fe76b074e5ce8163f10c32cbb6447..075d926d70cf184d60799c44928233dc7beb4dac 100644 (file)
@@ -606,15 +606,20 @@ class CRM_Contact_BAO_Group extends CRM_Contact_DAO_Group {
   public static function getPermissionClause($force = FALSE) {
     static $clause = 1;
     static $retrieved = FALSE;
-    if ((!$retrieved || $force) && !CRM_Core_Permission::check('view all contacts') && !CRM_Core_Permission::check('edit all contacts')) {
-      //get the allowed groups for the current user
-      $groups = CRM_ACL_API::group(CRM_ACL_API::VIEW);
-      if (!empty($groups)) {
-        $groupList = implode(', ', array_values($groups));
-        $clause = "groups.id IN ( $groupList ) ";
+    if (!$retrieved || $force) {
+      if (CRM_Core_Permission::check('view all contacts') || CRM_Core_Permission::check('edit all contacts')) {
+        $clause = 1;
       }
       else {
-        $clause = '1 = 0';
+        //get the allowed groups for the current user
+        $groups = CRM_ACL_API::group(CRM_ACL_API::VIEW);
+        if (!empty($groups)) {
+          $groupList = implode(', ', array_values($groups));
+          $clause = "groups.id IN ( $groupList ) ";
+        }
+        else {
+          $clause = '1 = 0';
+        }
       }
     }
     $retrieved = TRUE;
index 24e88478ed82936391b1ab17c6270aa69ca10ba5..7db267319b72ee11dd10224c5457fc0a17bb6a10 100644 (file)
@@ -3,7 +3,6 @@
 /**
  * Class CRM_Group_Page_AjaxTest
  * @group headless
- * @group ornery
  */
 class CRM_Group_Page_AjaxTest extends CiviUnitTestCase {
   /**