From: Tim Otten Date: Fri, 18 Sep 2020 02:11:19 +0000 (-0700) Subject: Container - Disable caching in as many unit-tests as we can X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=43a2114e251b61f1a0ef33ce1aa03d3b109540a1;p=civicrm-core.git Container - Disable caching in as many unit-tests as we can --- 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;