From 43a2114e251b61f1a0ef33ce1aa03d3b109540a1 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Thu, 17 Sep 2020 19:11:19 -0700 Subject: [PATCH] Container - Disable caching in as many unit-tests as we can --- Civi/Core/Container.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Civi/Core/Container.php b/Civi/Core/Container.php index acedf8a780..28b210e2b0 100644 --- a/Civi/Core/Container.php +++ b/Civi/Core/Container.php @@ -56,7 +56,7 @@ class Container { $cacheMode = defined('CIVICRM_CONTAINER_CACHE') ? CIVICRM_CONTAINER_CACHE : 'auto'; // In pre-installation environments, don't bother with caching. - if (!defined('CIVICRM_DSN') || $cacheMode === 'never' || \CRM_Utils_System::isInUpgradeMode()) { + if (!defined('CIVICRM_DSN') || defined('CIVICRM_TEST') || CIVICRM_UF === 'UnitTests' || $cacheMode === 'never' || \CRM_Utils_System::isInUpgradeMode()) { $containerBuilder = $this->createContainer(); $containerBuilder->compile(); return $containerBuilder; -- 2.25.1