Problem/Motivation

\Drupal\FunctionalTests\AssertLegacyTrait::assertNoCacheTag is deprecated but we still use it in core. Let's not.

Proposed resolution

Use $this->assertSession()->responseHeaderNotContains() instead

Remaining tasks

User interface changes

None

API changes

None

Data model changes

None

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

alexpott created an issue. See original summary.

alexpott’s picture

Status: Active » Needs review
FileSize
10.13 KB

Status: Needs review » Needs work

The last submitted patch, 2: 2963521-2.patch, failed testing. View results

alexpott’s picture

Status: Needs work » Needs review
FileSize
10.47 KB

Whoops.

borisson_’s picture

Status: Needs review » Needs work
Issue tags: +Needs reroll

The patch no longer applies, but it looks solid.

idebr’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
FileSize
10.53 KB

Reroll against 8.6.x

borisson_’s picture

Status: Needs review » Reviewed & tested by the community

The only remaining instances are in SearchPageCacheTagsTest, or in the legacy tests. I'm not sure if we should postpone this on that conversion, but since @alexpott didn't mention that in the original issue this looks good to go.

catch’s picture

Status: Reviewed & tested by the community » Fixed
+++ b/core/tests/Drupal/Tests/Listeners/DeprecationListenerTrait.php
@@ -121,7 +121,6 @@ public static function getSkippedDeprecations() {
       '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.',

Since the patch does this, it ensures that future conversions won't use the deprecated method, so I think it's fine to get in as is.

Committed 323c56c and pushed to 8.6.x. Thanks!

  • catch committed 323c56c on 8.6.x
    Issue #2963521 by alexpott, idebr: Remove usages of assertNoCacheTag as...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.