You are here

protected function WebTestBase::assertNoCacheTag in Drupal 8

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

Parameters

string $cache_tag: The cache tag to check.

File

core/modules/simpletest/src/WebTestBase.php, line 2065

Class

WebTestBase
Test case for typical Drupal tests.

Namespace

Drupal\simpletest

Code

protected function assertNoCacheTag($cache_tag) {
  $cache_tags = explode(' ', $this
    ->drupalGetHeader('X-Drupal-Cache-Tags'));
  $this
    ->assertFalse(in_array($cache_tag, $cache_tags), "'" . $cache_tag . "' is absent in the X-Drupal-Cache-Tags header.");
}