You are here

protected function AssertPageCacheContextsAndTagsTrait::debugCacheTags in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/system/src/Tests/Cache/AssertPageCacheContextsAndTagsTrait.php \Drupal\system\Tests\Cache\AssertPageCacheContextsAndTagsTrait::debugCacheTags()

Provides debug information for cache tags.

Parameters

string[] $actual_tags: The actual cache tags.

string[] $expected_tags: The expected cache tags.

4 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.
AssertViewsCacheTagsTrait::assertViewsCacheTags in core/modules/views/src/Tests/AssertViewsCacheTagsTrait.php
Asserts a view's result & render cache items' cache tags.
AssertViewsCacheTagsTrait::assertViewsCacheTagsFromStaticRenderArray in core/modules/views/src/Tests/AssertViewsCacheTagsTrait.php
Asserts a view's result & render cache items' cache tags.

File

core/modules/system/src/Tests/Cache/AssertPageCacheContextsAndTagsTrait.php, line 91
Contains \Drupal\system\Tests\Cache\AssertPageCacheContextsAndTagsTrait.

Class

AssertPageCacheContextsAndTagsTrait
Provides test assertions for testing page-level cache contexts & tags.

Namespace

Drupal\system\Tests\Cache

Code

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)));
  }
}