diff --git a/core/modules/big_pipe/tests/src/Functional/BigPipeTest.php b/core/modules/big_pipe/tests/src/Functional/BigPipeTest.php index 92d1a86..cf2df4a 100644 --- a/core/modules/big_pipe/tests/src/Functional/BigPipeTest.php +++ b/core/modules/big_pipe/tests/src/Functional/BigPipeTest.php @@ -156,7 +156,7 @@ public function testBigPipe() { $this->drupalGet(Url::fromRoute('big_pipe_test')); $this->assertBigPipeResponseHeadersPresent(); - $this->assertNoCacheTag('cache_tag_set_in_lazy_builder'); + $this->assertSession()->responseHeaderNotContains('X-Drupal-Cache-Tags', 'cache_tag_set_in_lazy_builder'); $this->setCsrfTokenSeedInTestEnvironment(); $cases = $this->getTestCases(); @@ -236,7 +236,7 @@ public function testBigPipeNoJs() { $this->drupalGet(Url::fromRoute('big_pipe_test')); $this->assertBigPipeResponseHeadersPresent(); - $this->assertNoCacheTag('cache_tag_set_in_lazy_builder'); + $this->assertSession()->responseHeaderNotContains('X-Drupal-Cache-Tags', 'cache_tag_set_in_lazy_builder'); $this->setCsrfTokenSeedInTestEnvironment(); $cases = $this->getTestCases(); diff --git a/core/modules/block/tests/src/Functional/BlockInstallTest.php b/core/modules/block/tests/src/Functional/BlockInstallTest.php index c6fd1eb..eb6c5fc 100644 --- a/core/modules/block/tests/src/Functional/BlockInstallTest.php +++ b/core/modules/block/tests/src/Functional/BlockInstallTest.php @@ -15,7 +15,7 @@ public function testCacheTagInvalidationUponInstallation() { // Warm the page cache. $this->drupalGet(''); $this->assertNoText('Powered by Drupal'); - $this->assertNoCacheTag('config:block_list'); + $this->assertSession()->responseHeaderNotContains('X-Drupal-Cache-Tags', 'config:block_list'); // Install the block module, and place the "Powered by Drupal" block. $this->container->get('module_installer')->install(['block', 'shortcut']); diff --git a/core/modules/page_cache/tests/src/Functional/PageCacheTest.php b/core/modules/page_cache/tests/src/Functional/PageCacheTest.php index bf4951d..8b5442c 100644 --- a/core/modules/page_cache/tests/src/Functional/PageCacheTest.php +++ b/core/modules/page_cache/tests/src/Functional/PageCacheTest.php @@ -327,20 +327,20 @@ public function testPageCacheAnonymousRolePermissions() { $this->drupalGet($content_url); $this->assertText('Permission to pet llamas: no!'); $this->assertCacheContext('user.permissions'); - $this->assertNoCacheTag('config:user.role.authenticated'); + $this->assertSession()->responseHeaderNotContains('X-Drupal-Cache-Tags', 'config:user.role.authenticated'); $this->drupalGet($route_access_url); $this->assertCacheContext('user.permissions'); - $this->assertNoCacheTag('config:user.role.authenticated'); + $this->assertSession()->responseHeaderNotContains('X-Drupal-Cache-Tags', 'config:user.role.authenticated'); // 4. authenticated user, with permission. user_role_grant_permissions(RoleInterface::AUTHENTICATED_ID, ['pet llamas']); $this->drupalGet($content_url); $this->assertText('Permission to pet llamas: yes!'); $this->assertCacheContext('user.permissions'); - $this->assertNoCacheTag('config:user.role.authenticated'); + $this->assertSession()->responseHeaderNotContains('X-Drupal-Cache-Tags', 'config:user.role.authenticated'); $this->drupalGet($route_access_url); $this->assertCacheContext('user.permissions'); - $this->assertNoCacheTag('config:user.role.authenticated'); + $this->assertSession()->responseHeaderNotContains('X-Drupal-Cache-Tags', 'config:user.role.authenticated'); } /** diff --git a/core/modules/system/tests/src/Functional/Common/EarlyRenderingControllerTest.php b/core/modules/system/tests/src/Functional/Common/EarlyRenderingControllerTest.php index c3d1bb9..451cef9 100644 --- a/core/modules/system/tests/src/Functional/Common/EarlyRenderingControllerTest.php +++ b/core/modules/system/tests/src/Functional/Common/EarlyRenderingControllerTest.php @@ -50,17 +50,17 @@ public function testEarlyRendering() { $this->drupalGet(Url::fromRoute('early_rendering_controller_test.response')); $this->assertResponse(200); $this->assertRaw('Hello world!'); - $this->assertNoCacheTag('foo'); + $this->assertSession()->responseHeaderNotContains('X-Drupal-Cache-Tags', 'foo'); $this->drupalGet(Url::fromRoute('early_rendering_controller_test.response.early')); $this->assertResponse(200); $this->assertRaw('Hello world!'); - $this->assertNoCacheTag('foo'); + $this->assertSession()->responseHeaderNotContains('X-Drupal-Cache-Tags', 'foo'); // Response object with attachments: non-early & early. $this->drupalGet(Url::fromRoute('early_rendering_controller_test.response-with-attachments')); $this->assertResponse(200); $this->assertRaw('Hello world!'); - $this->assertNoCacheTag('foo'); + $this->assertSession()->responseHeaderNotContains('X-Drupal-Cache-Tags', 'foo'); $this->drupalGet(Url::fromRoute('early_rendering_controller_test.response-with-attachments.early')); $this->assertResponse(500); $this->assertRaw('The controller result claims to be providing relevant cache metadata, but leaked metadata was detected. Please ensure you are not rendering content too early. Returned object class: Drupal\early_rendering_controller_test\AttachmentsTestResponse.'); @@ -69,7 +69,7 @@ public function testEarlyRendering() { $this->drupalGet(Url::fromRoute('early_rendering_controller_test.cacheable-response')); $this->assertResponse(200); $this->assertRaw('Hello world!'); - $this->assertNoCacheTag('foo'); + $this->assertSession()->responseHeaderNotContains('X-Drupal-Cache-Tags', 'foo'); $this->drupalGet(Url::fromRoute('early_rendering_controller_test.cacheable-response.early')); $this->assertResponse(500); $this->assertRaw('The controller result claims to be providing relevant cache metadata, but leaked metadata was detected. Please ensure you are not rendering content too early. Returned object class: Drupal\early_rendering_controller_test\CacheableTestResponse.'); @@ -78,17 +78,17 @@ public function testEarlyRendering() { $this->drupalGet(Url::fromRoute('early_rendering_controller_test.domain-object')); $this->assertResponse(200); $this->assertRaw('TestDomainObject'); - $this->assertNoCacheTag('foo'); + $this->assertSession()->responseHeaderNotContains('X-Drupal-Cache-Tags', 'foo'); $this->drupalGet(Url::fromRoute('early_rendering_controller_test.domain-object.early')); $this->assertResponse(200); $this->assertRaw('TestDomainObject'); - $this->assertNoCacheTag('foo'); + $this->assertSession()->responseHeaderNotContains('X-Drupal-Cache-Tags', 'foo'); // Basic domain object with attachments: non-early & early. $this->drupalGet(Url::fromRoute('early_rendering_controller_test.domain-object-with-attachments')); $this->assertResponse(200); $this->assertRaw('AttachmentsTestDomainObject'); - $this->assertNoCacheTag('foo'); + $this->assertSession()->responseHeaderNotContains('X-Drupal-Cache-Tags', 'foo'); $this->drupalGet(Url::fromRoute('early_rendering_controller_test.domain-object-with-attachments.early')); $this->assertResponse(500); $this->assertRaw('The controller result claims to be providing relevant cache metadata, but leaked metadata was detected. Please ensure you are not rendering content too early. Returned object class: Drupal\early_rendering_controller_test\AttachmentsTestDomainObject.'); @@ -97,7 +97,7 @@ public function testEarlyRendering() { $this->drupalGet(Url::fromRoute('early_rendering_controller_test.cacheable-domain-object')); $this->assertResponse(200); $this->assertRaw('CacheableTestDomainObject'); - $this->assertNoCacheTag('foo'); + $this->assertSession()->responseHeaderNotContains('X-Drupal-Cache-Tags', 'foo'); $this->drupalGet(Url::fromRoute('early_rendering_controller_test.cacheable-domain-object.early')); $this->assertResponse(500); $this->assertRaw('The controller result claims to be providing relevant cache metadata, but leaked metadata was detected. Please ensure you are not rendering content too early. Returned object class: Drupal\early_rendering_controller_test\CacheableTestDomainObject.'); diff --git a/core/tests/Drupal/Tests/Core/Assert/AssertLegacyTraitTest.php b/core/tests/Drupal/Tests/Core/Assert/AssertLegacyTraitTest.php index f6ec313..bb39c6d 100644 --- a/core/tests/Drupal/Tests/Core/Assert/AssertLegacyTraitTest.php +++ b/core/tests/Drupal/Tests/Core/Assert/AssertLegacyTraitTest.php @@ -167,6 +167,7 @@ public function testAssertNoPattern() { /** * @covers ::assertNoCacheTag + * @expectedDeprecation assertNoCacheTag() is deprecated and scheduled for removal in Drupal 9.0.0. Use $this->assertSession()->responseHeaderNotContains() instead. See https://www.drupal.org/node/2864029. */ public function testAssertNoCacheTag() { $this->webAssert diff --git a/core/tests/Drupal/Tests/Listeners/DeprecationListenerTrait.php b/core/tests/Drupal/Tests/Listeners/DeprecationListenerTrait.php index 9dfd142..4328482 100644 --- a/core/tests/Drupal/Tests/Listeners/DeprecationListenerTrait.php +++ b/core/tests/Drupal/Tests/Listeners/DeprecationListenerTrait.php @@ -121,7 +121,6 @@ public static function getSkippedDeprecations() { 'Providing settings under \'handler_settings\' is deprecated and will be removed before 9.0.0. Move the settings in the root of the configuration array. See https://www.drupal.org/node/2870971.', 'AssertLegacyTrait::getRawContent() is scheduled for removal in Drupal 9.0.0. Use $this->getSession()->getPage()->getContent() instead.', 'AssertLegacyTrait::getAllOptions() is scheduled for removal in Drupal 9.0.0. Use $element->findAll(\'xpath\', \'option\') instead.', - 'assertNoCacheTag() is deprecated and scheduled for removal in Drupal 9.0.0. Use $this->assertSession()->responseHeaderNotContains() instead. See https://www.drupal.org/node/2864029.', 'assertNoPattern() is deprecated and scheduled for removal in Drupal 9.0.0. Use $this->assertSession()->responseNotMatches($pattern) instead. See https://www.drupal.org/node/2864262.', 'The Drupal\config\Tests\AssertConfigEntityImportTrait is deprecated in Drupal 8.4.1 and will be removed before Drupal 9.0.0. Instead, use \Drupal\Tests\config\Traits\AssertConfigEntityImportTrait. See https://www.drupal.org/node/2916197.', 'Drupal\system\Tests\Menu\AssertBreadcrumbTrait is deprecated in Drupal 8.4.0 and will be removed before Drupal 9.0.0. Instead, use \Drupal\Tests\system\Functional\Menu\AssertBreadcrumbTrait',