CRM test fix CRM_Group_Page_AjaxTest.testTraditionalACL
authorjitendrapurohit <jitendra.purohit@webaccessglobal.com>
Wed, 15 Jul 2015 13:14:24 +0000 (18:44 +0530)
committerjitendrapurohit <jitendra.purohit@webaccessglobal.com>
Wed, 15 Jul 2015 13:14:24 +0000 (18:44 +0530)
tests/phpunit/CiviTest/CiviUnitTestCase.php

index a7a361e3384dd21e65430fb9ecd36aca1ee2e16a..bb9fe0502073e6b87a8eb715d2033b220516bcb0 100755 (executable)
@@ -3079,10 +3079,6 @@ AND    ( TABLE_NAME LIKE 'civicrm_value_%' )
       'view picked', 'civicrm_group',  $this->_permissionedGroup, 'Edit', 'civicrm_saved_search', {$this->_permissionedDisabledGroup}, 1
       );
       ");
-      //flush cache
-      CRM_ACL_BAO_Cache::resetCache();
-      CRM_Contact_BAO_Group::getPermissionClause(TRUE);
-      CRM_ACL_API::groupPermission('whatever', 9999, NULL, 'civicrm_saved_search', NULL, NULL, TRUE);
     }
 
     $this->_loggedInUser = CRM_Core_Session::singleton()->get('userID');
@@ -3090,6 +3086,13 @@ AND    ( TABLE_NAME LIKE 'civicrm_value_%' )
       'group_id' => $this->_permissionedGroup,
       'contact_id' => $this->_loggedInUser,
     ));
+
+    if (!$isProfile) {
+      //flush cache
+      CRM_ACL_BAO_Cache::resetCache();
+      CRM_Contact_BAO_Group::getPermissionClause(TRUE);
+      CRM_ACL_API::groupPermission('whatever', 9999, NULL, 'civicrm_saved_search', NULL, NULL, TRUE);
+    }
   }
 
   /**