function AssertLegacyTrait::assertCacheTag
Same name in other branches
- 8.9.x 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 858
Class
- AssertLegacyTrait
- Provides convenience methods for assertions in browser tests.
Namespace
Drupal\FunctionalTestsCode
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);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.