diff --git a/core/lib/Drupal/Core/Cache/CacheCollector.php b/core/lib/Drupal/Core/Cache/CacheCollector.php index bbfd77e..28c9026 100644 --- a/core/lib/Drupal/Core/Cache/CacheCollector.php +++ b/core/lib/Drupal/Core/Cache/CacheCollector.php @@ -209,9 +209,18 @@ protected function updateCache($lock = TRUE) { } /** - * Implemnts KernelServiceTerminator::terminate(). + * Implements KernelServiceTerminator::terminate(). */ public function terminate() { $this->updateCache(); } + + /** + * Implements CacheCollectorInterface::reset(). + */ + public function reset() { + $this->storage = array(); + $this->keysToPersist = array(); + $this->keysToRemove = array(); + } } diff --git a/core/lib/Drupal/Core/Cache/CacheCollectorInterface.php b/core/lib/Drupal/Core/Cache/CacheCollectorInterface.php index be9385f..f54f1d7 100644 --- a/core/lib/Drupal/Core/Cache/CacheCollectorInterface.php +++ b/core/lib/Drupal/Core/Cache/CacheCollectorInterface.php @@ -64,4 +64,10 @@ public function delete($key); * Key that identifies the data. */ public function has($key); + + /** + * Resets the local cache. + */ + public function reset(); + } diff --git a/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php b/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php index f886992..ce9ba3e 100644 --- a/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php +++ b/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php @@ -899,6 +899,7 @@ protected function refreshVariables() { cache('bootstrap')->delete('variables'); $conf = variable_initialize(); drupal_container()->get('config.factory')->reset(); + drupal_container()->get('state')->reset(); } /**