You are here

protected function AssertLegacyTrait::assertNoCacheTag in Drupal 9

Same name and namespace in other branches
  1. 8 core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php \Drupal\FunctionalTests\AssertLegacyTrait::assertNoCacheTag()

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

Parameters

string $cache_tag: The cache tag to check.

Deprecated

in drupal:8.4.0 and is removed from drupal:10.0.0. Use $this->assertSession()->responseHeaderNotContains() instead.

See also

https://www.drupal.org/node/3129738

1 call to AssertLegacyTrait::assertNoCacheTag()
AssertLegacyTraitTest::testAssertNoCacheTag in core/tests/Drupal/Tests/Core/Assert/AssertLegacyTraitTest.php
@covers ::assertNoCacheTag

File

core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php, line 875

Class

AssertLegacyTrait
Provides convenience methods for assertions in browser tests.

Namespace

Drupal\FunctionalTests

Code

protected function assertNoCacheTag($cache_tag) {
  @trigger_error('AssertLegacyTrait::assertNoCacheTag() is deprecated in drupal:8.4.0 and is removed from drupal:10.0.0. Use $this->assertSession()->responseHeaderNotContains() instead. See https://www.drupal.org/node/3129738', E_USER_DEPRECATED);
  $this
    ->assertSession()
    ->responseHeaderNotContains('X-Drupal-Cache-Tags', $cache_tag);
}