You are here

protected function AssertLegacyTrait::assertCacheTag in Drupal 9

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

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

Parameters

string $expected_cache_tag: The expected cache tag.

Deprecated

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

See also

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

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

File

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

Class

AssertLegacyTrait
Provides convenience methods for assertions in browser tests.

Namespace

Drupal\FunctionalTests

Code

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