Problem/Motivation

AssertLegacyTrait::assertOption() is deprecated in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->assertSession()->optionExists() instead. See https://www.drupal.org/node/3129738

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Comments

mondrake created an issue. See original summary.

mondrake’s picture

Status: Active » Needs review
StatusFileSize
new2.33 KB

Kick-off

Status: Needs review » Needs work

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

mondrake’s picture

Assigned: Unassigned » mondrake

On this

mondrake’s picture

Assigned: mondrake » Unassigned
Status: Needs work » Needs review
StatusFileSize
new19.87 KB

Removed usages, inlined comments in code where appropriate, converted a test to legacy to check deprecations, removed silencers.

jungle’s picture

Issue tags: +Deprecated assertions

Adding the "Deprecated assertions" tag to add this into the kanban board https://contribkanban.com/board/Deprecatedassertions

daffie’s picture

Status: Needs review » Needs work
Issue tags: +Needs reroll
mrinalini9’s picture

Assigned: Unassigned » mrinalini9
mrinalini9’s picture

Assigned: mrinalini9 » Unassigned
Status: Needs work » Needs review
StatusFileSize
new19.95 KB

Rerolled patch for 9.1.x, please review.

daffie’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: -Needs reroll

All occurrences of $this->assert(No)Option() have been replaced by $this->assertSession()->option(Not)Exists().
The method was already deprecated in 8.2.
Test has been added for deprecation testing for both methods.
The supression of the deprecation message has been removed for both methods.
All code changes look good to me.
For me it is RTBC.

xjm’s picture

Title: Replace usages of AssertLegacyTrait::assert(No)Option, that is deprecated » Replace usages of deprecated AssertLegacyTrait::assert(No)Option()
xjm’s picture

BTW I'm going to start recommending for these issues that we not do cleanups like removing the message parameters in the same patches. (#3132964: assertResponse() does not actually support a $message parameter, so stop passing one was different because that was the bug.) If we notice message parameters that aren't helpful, we can remove them and/or move them to inline documentation in separate issues.

  • xjm committed 68a59ee on 9.1.x
    Issue #3139421 by mondrake, mrinalini9, daffie: Replace usages of...
xjm’s picture

Version: 9.1.x-dev » 8.8.x-dev
Status: Reviewed & tested by the community » Patch (to be ported)

Committed to 9.1.x. Let's make backport versions of this patch without the unsilencing of the deprecation message.

The backport here can include the same changes as the original commit. Please do make note of #12 for subsequent issues, though. If you notice unhelpful message parameters while patching, just make note of them and stick them in a followup.

xjm’s picture

Title: Replace usages of deprecated AssertLegacyTrait::assert(No)Option() » [backport] Replace usages of deprecated AssertLegacyTrait::assert(No)Option()
saurabh-2k17’s picture

Assigned: Unassigned » saurabh-2k17
saurabh-2k17’s picture

Assigned: saurabh-2k17 » Unassigned
sja112’s picture

Assigned: Unassigned » sja112

On this.

sja112’s picture

Assigned: sja112 » Unassigned
Status: Patch (to be ported) » Needs review
StatusFileSize
new17.55 KB

Patch for D9.0 and D8.9

Status: Needs review » Needs work

The last submitted patch, 19: 3139421-19.patch, failed testing. View results

sja112’s picture

Assigned: Unassigned » sja112
bunty badgujar’s picture

Added 8.8.x test in #19

sja112’s picture

Assigned: sja112 » Unassigned
Status: Needs work » Needs review
StatusFileSize
new16.57 KB

Fixing failed test.

sja112’s picture

StatusFileSize
new16.58 KB

Patch for D8.8

ketikagrover’s picture

Status: Needs review » Reviewed & tested by the community

The occurrences have been replaced by $this->assertSession().
Changes verified on my local for D8.8, D8.9,D9.0
Looks good to me.Moving this to RTBC
Thanks

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs reroll

Unfortunately we need a reroll for 9.0.x / 8.9.x patch.

munish.kumar’s picture

Assigned: Unassigned » munish.kumar
munish.kumar’s picture

Status: Needs work » Needs review
StatusFileSize
new16.75 KB

Patch rerolled for branch 8.9.x. Interdiff is not generated from #23

munish.kumar’s picture

StatusFileSize
new16.75 KB

Please ignore the last patch, Here is the latest patch that rerolled for both the branches 9.0.x / 8.9.x . Thanks Please review.

munish.kumar’s picture

Assigned: munish.kumar » Unassigned
mondrake’s picture

Title: [backport] Replace usages of deprecated AssertLegacyTrait::assert(No)Option() » Replace usages of deprecated AssertLegacyTrait::assert(No)Option()
Status: Needs review » Fixed

Marking fixed on the basis of #3027952-54: [Plan] Remove the usage of deprecated methods in tests. Please open a separate issue for backport.

longwave’s picture

Version: 8.9.x-dev » 9.1.x-dev

Status: Fixed » Closed (fixed)

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