You are here

protected function WebTestBase::assertCacheTag in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/simpletest/src/WebTestBase.php \Drupal\simpletest\WebTestBase::assertCacheTag()

Asserts whether an expected cache tag was present in the last response.

Parameters

string $expected_cache_tag: The expected cache tag.

24 calls to WebTestBase::assertCacheTag()
BlockInstallTest::testCacheTagInvalidationUponInstallation in core/modules/block/src/Tests/BlockInstallTest.php
BlockSystemBrandingTest::testSystemBrandingSettings in core/modules/block/src/Tests/BlockSystemBrandingTest.php
Tests system branding block configuration.
BookTest::testBook in core/modules/book/src/Tests/BookTest.php
Tests book functionality through node interfaces.
CacheabilityMetadataConfigOverrideIntegrationTest::testConfigOverride in core/modules/config/src/Tests/CacheabilityMetadataConfigOverrideIntegrationTest.php
Tests if config overrides correctly set cacheability metadata.
CommentAnonymousTest::testAnonymous in core/modules/comment/src/Tests/CommentAnonymousTest.php
Tests anonymous comment functionality.

... See full list

File

core/modules/simpletest/src/WebTestBase.php, line 3021
Contains \Drupal\simpletest\WebTestBase.

Class

WebTestBase
Test case for typical Drupal tests.

Namespace

Drupal\simpletest

Code

protected function assertCacheTag($expected_cache_tag) {
  $cache_tags = explode(' ', $this
    ->drupalGetHeader('X-Drupal-Cache-Tags'));
  $this
    ->assertTrue(in_array($expected_cache_tag, $cache_tags), "'" . $expected_cache_tag . "' is present in the X-Drupal-Cache-Tags header.");
}