function AssertLegacyTrait::assertNoCacheTag

Same name in other branches
  1. 9 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 @expectedDeprecation AssertLegacyTrait::assertNoCacheTag() is deprecated in drupal:8.4.0 and is removed from drupal:10.0.0. Use $this->assertSession()->responseHeaderNotContains() instead. Seeā€¦

File

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

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);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.