From 90dee8d127a041ae385b4ea6a7feb452ff6489c4 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Fri, 31 Jan 2014 18:10:04 +1300 Subject: [PATCH] ACL Core, add a way for unit tests to flush in-function cache --- CRM/ACL/API.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/CRM/ACL/API.php b/CRM/ACL/API.php index d81259b7b4..8463f8b265 100644 --- a/CRM/ACL/API.php +++ b/CRM/ACL/API.php @@ -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; -- 2.25.1