From 172d8915b773e7768db4308911912db987d8158e Mon Sep 17 00:00:00 2001 From: Robbie Averill Date: Thu, 4 Oct 2018 17:49:35 +0200 Subject: [PATCH] Clear cache between ThemeResourceLoader tests --- src/View/ThemeResourceLoader.php | 8 ++++++++ tests/php/Core/Manifest/ThemeResourceLoaderTest.php | 3 +++ 2 files changed, 11 insertions(+) diff --git a/src/View/ThemeResourceLoader.php b/src/View/ThemeResourceLoader.php index 74c619446..9a742489b 100644 --- a/src/View/ThemeResourceLoader.php +++ b/src/View/ThemeResourceLoader.php @@ -350,4 +350,12 @@ class ThemeResourceLoader } return $paths; } + + /** + * Clear any internally cached data from memory + */ + public static function flushCache() + { + static::$cacheData = []; + } } diff --git a/tests/php/Core/Manifest/ThemeResourceLoaderTest.php b/tests/php/Core/Manifest/ThemeResourceLoaderTest.php index 6ff3f7c21..aaf8ff27e 100644 --- a/tests/php/Core/Manifest/ThemeResourceLoaderTest.php +++ b/tests/php/Core/Manifest/ThemeResourceLoaderTest.php @@ -54,6 +54,9 @@ class ThemeResourceLoaderTest extends SapphireTest // New Loader for that root $this->loader = new ThemeResourceLoader($this->base); $this->loader->addSet('$default', $this->manifest); + + // Flush any cached values + ThemeResourceLoader::flushCache(); } protected function tearDown()