AssertPageCacheContextsAndTagsTrait deprecated
trait AssertPageCacheContextsAndTagsTrait (View source)
deprecated
Provides test assertions for testing page-level cache contexts & tags.
Can be used by test classes that extend \Drupal\simpletest\WebTestBase.
Methods
Enables page caching.
Gets a specific header value as array.
Asserts whether an expected cache context was present in the last response.
Asserts that a cache context was not present in the last response.
Asserts page cache miss, then hit for the given URL; checks cache headers.
Provides debug information for cache tags.
Ensures that some cache tags are present in the current response.
Ensures that some cache contexts are present in the current response.
Asserts the max age header.
Details
protected
enablePageCaching()
Enables page caching.
protected string[]
getCacheHeaderValues(string $header_name)
Gets a specific header value as array.
protected
assertCacheContext(string $expected_cache_context)
Asserts whether an expected cache context was present in the last response.
protected
assertNoCacheContext(string $not_expected_cache_context)
Asserts that a cache context was not present in the last response.
protected
assertPageCacheContextsAndTags(Url $url, array $expected_contexts, array $expected_tags)
Asserts page cache miss, then hit for the given URL; checks cache headers.
protected
debugCacheTags(array $actual_tags, array $expected_tags)
Provides debug information for cache tags.
protected
assertCacheTags(array $expected_tags, bool $include_default_tags = TRUE)
Ensures that some cache tags are present in the current response.
protected bool
assertCacheContexts(array $expected_contexts, string $message = NULL, bool $include_default_contexts = TRUE)
Ensures that some cache contexts are present in the current response.
protected
assertCacheMaxAge(int $max_age)
Asserts the max age header.