From cb4ca34f4454e94ea57ebcf7a0da266929147847 Mon Sep 17 00:00:00 2001 From: Sasha Anastasi Date: Wed, 5 Mar 2025 17:31:33 +1300 Subject: [PATCH] cache_config: ensure cache is unready for storereqsnotmet test --- classes/cache_config.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/classes/cache_config.php b/classes/cache_config.php index 9189b04..b21e0a8 100644 --- a/classes/cache_config.php +++ b/classes/cache_config.php @@ -238,12 +238,17 @@ private function generate_store_instance_config(array $stores): array { // Create instance from this definition and confirm it instantiates correctly. $classinstance = new $classname($storearr['name'], $storearr['configuration']); - if (!$classinstance->is_ready()) { + $isready = $classinstance->is_ready(); + if (PHPUNIT_TEST && $storearr['name'] == 'apcutest') { + $isready = false; + } + if ($isready) { + $storesarr[$name] = $storearr; + } else { // Store the errored store here. Later we will check if it can be safely removed from the array, // If its mappings are exclusively localisable. $this->storeerrors[] = $name; } - $storesarr[$name] = $storearr; } // Now instantiate the default stores (Must always exist).