From 4203ec9ef3fede8dd8a0f40a3c42b2eea3c627ba 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 664818a5ba..f3d343dc9b 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