Issue #2433595 by chx, Berdir: WebTestBase::refreshVariables only resets cache_tags.invalidator.checksum

8.0.x
Alex Pott 2015-03-13 14:34:08 +00:00
parent 37fec7e9e9
commit b6ee00e248
2 changed files with 14 additions and 1 deletions

View File

@ -41,6 +41,19 @@ class CacheTagsInvalidator implements CacheTagsInvalidatorInterface {
} }
} }
/**
* Reset statically cached tags in all cache tag checksum services.
*
* This is only used by tests.
*/
public function resetChecksums() {
foreach ($this->invalidators as $invalidator) {
if ($invalidator instanceof CacheTagsChecksumInterface) {
$invalidator->reset();
}
}
}
/** /**
* Adds a cache tags invalidator. * Adds a cache tags invalidator.
* *

View File

@ -1192,7 +1192,7 @@ abstract class WebTestBase extends TestBase {
*/ */
protected function refreshVariables() { protected function refreshVariables() {
// Clear the tag cache. // Clear the tag cache.
\Drupal::service('cache_tags.invalidator.checksum')->reset(); \Drupal::service('cache_tags.invalidator')->resetChecksums();
foreach (Cache::getBins() as $backend) { foreach (Cache::getBins() as $backend) {
if (is_callable(array($backend, 'reset'))) { if (is_callable(array($backend, 'reset'))) {
$backend->reset(); $backend->reset();