Merge pull request #2998 from yashodha/CRM-14500
[civicrm-core.git] / CRM / ACL / API.php
index d81259b7b4d1dc8bef1a8ff0948ed196e0ac3af6..8463f8b265e421d7d509a6867e0ef297c7264779 100644 (file)
@@ -178,10 +178,17 @@ class CRM_ACL_API {
     $contactID      = NULL,
     $tableName      = 'civicrm_saved_search',
     $allGroups      = NULL,
-    $includedGroups = NULL
+    $includedGroups = NULL,
+    $flush = FALSE
   ) {
-    static $cache = array();
 
+    static $cache = array();
+    //@todo this is pretty hacky!!!
+    //adding a way for unit tests to flush the cache
+    if ($flush) {
+      $cache = array();
+      return;
+    }
     if (!$contactID) {
       $session = CRM_Core_Session::singleton();
       $contactID = NULL;