function AssertPageCacheContextsAndTagsTrait::debugCacheTags
Provides debug information for cache tags.
Parameters
string[] $actual_tags: The actual cache tags.
string[] $expected_tags: The expected cache tags.
2 calls to AssertPageCacheContextsAndTagsTrait::debugCacheTags()
- AssertPageCacheContextsAndTagsTrait::assertCacheTags in core/
modules/ system/ src/ Tests/ Cache/ AssertPageCacheContextsAndTagsTrait.php - Ensures that some cache tags are present in the current response.
- AssertPageCacheContextsAndTagsTrait::assertPageCacheContextsAndTags in core/
modules/ system/ src/ Tests/ Cache/ AssertPageCacheContextsAndTagsTrait.php - Asserts page cache miss, then hit for the given URL; checks cache headers.
File
-
core/
modules/ system/ src/ Tests/ Cache/ AssertPageCacheContextsAndTagsTrait.php, line 114
Class
- AssertPageCacheContextsAndTagsTrait
- Provides test assertions for testing page-level cache contexts & tags.
Namespace
Drupal\system\Tests\CacheCode
protected function debugCacheTags(array $actual_tags, array $expected_tags) {
if ($actual_tags !== $expected_tags) {
debug('Unwanted cache tags in response: ' . implode(',', array_diff($actual_tags, $expected_tags)));
debug('Missing cache tags in response: ' . implode(',', array_diff($expected_tags, $actual_tags)));
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.