Simpletest's legacy assertion methods are deprecated.
The test assertion methods, originally inherited in Drupal 8 from Simpletest, have been replaced by PHPUnit methods along the Drupal 8 lifecycle, and are now formally deprecated for removal in Drupal 10.
See https://www.drupal.org/node/3129738 and replace a

Comments

siddhant.bhosale created an issue. See original summary.

siddhant.bhosale’s picture

Assigned: siddhant.bhosale » Unassigned
Status: Active » Needs review
StatusFileSize
new8.21 KB

I have replaced all the occurances of AssertLegacyTrait::assert(No)LinkByHref() with $this->assertSession()->linkByHrefExists() or $this->assertSession()->linkByHrefNotExists() . Please review.

damienmckenna’s picture

Status: Needs review » Needs work

Thank you for taking the time to do this.

That said, can you please combine the other patches into this one - there's no need for five+ issues for what is ultimately one set of changes (deprecated APIs in a trait).

siddhant.bhosale’s picture

Title: Replace usages of AssertLegacyTrait::assert(No)LinkByHref() that is deprecated. » Replace usages of assertions that are deprecated.
Assigned: Unassigned » siddhant.bhosale
Issue summary: View changes
siddhant.bhosale’s picture

Assigned: siddhant.bhosale » Unassigned
Status: Needs work » Needs review
StatusFileSize
new59.77 KB

I have combined the patches for the following issues :
https://www.drupal.org/project/metatag/issues/3158187
https://www.drupal.org/project/metatag/issues/3158189
https://www.drupal.org/project/metatag/issues/3158255
and removed all the other deprecated assertions in this patch.

Please review.

Status: Needs review » Needs work

The last submitted patch, 5: 3158186-5.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

rahulrasgon’s picture

Assigned: Unassigned » rahulrasgon
rahulrasgon’s picture

Assigned: rahulrasgon » Unassigned
Status: Needs work » Needs review
StatusFileSize
new58.74 KB
new2.19 KB

Fixed the Failed test cases for patch #5.
Please review.

damienmckenna’s picture

One small request: could you please shorten the code so that the session is stored in a variable and then checked against instead of constantly calling $this->assertSession()? Thank you.

damienmckenna’s picture

Version: 8.x-1.13 » 8.x-1.x-dev
Status: Needs review » Needs work
rokzabukovec’s picture

StatusFileSize
new76.91 KB

I rerolled the patch and fix the assertSession to be stored in the variable so that it doesn't need to $this->assertsession() be called over and over again.
Please review.

rokzabukovec’s picture

Status: Needs work » Needs review
sabina.h’s picture

StatusFileSize
new82.2 KB

Hi, I created a new patch because the previous ones aren't applying anymore. Needs review.

damienmckenna’s picture

Status: Needs review » Fixed
Parent issue: » #3186720: Plan for Metatag 8.x-1.16

Committed. Thank you all!

damienmckenna’s picture

Status: Fixed » Closed (fixed)

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