Problem/Motivation

In the very challenging move from SimpleTest to PHPUnit, we create a WebformAssertLegacyTrait which did not deprecate commonly used assertions.

Proposed resolution

In preparation for Drupal 10, we need to remove the WebformAssertLegacyTrait.

Remaining tasks

Notes

  • We can use PHPStorm to find method usage.
  • If this is done correctly, we should be able to replace WebformAssertLegacyTrait with AssertLegacyTrait, so that the methods will be deprecated.
  • Tests are allow to change but people maybe extending WebformBrowserTestBase and relying on the WebformAssertLegacyTrait.
  • Use the change record for suggestions and replacement patterns

Preparation

  • Standardize how $this->assertSession() is used.

Steps to remove WebformAssertLegacyTrait

  • Remove unused methods for tests.
  • Renamed simple methods (::assertEqual => assertEquals)
  • Search replace more complese methods ($this->assertSomething() => $this->assertSession()->something())
  • Document refactoring for critical methods (::drupalPostForm)

User interface changes

N/A

API changes

Deprecated assertions will now be flagged as deprecated.

Data model changes

N/A

Issue fork webform-3255904

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jrockowitz created an issue. See original summary.

jrockowitz’s picture

Status: Active » Needs review
FileSize
2.89 KB

The attached patch replaces the WebformAssertLegacyTrait with the deprecated AssertLegacyTrait;

jrockowitz’s picture

Issue summary: View changes

Status: Needs review » Needs work

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

jrockowitz’s picture

After the clean-up, we should replace WebformAssertLegacyTrait with the deprecated AssertLegacyTrait.

jrockowitz’s picture

Issue summary: View changes

jrockowitz’s picture

Status: Needs work » Needs review

jrockowitz’s picture

jrockowitz’s picture

Status: Needs review » Fixed

  • jrockowitz committed 0c680c7 on 6.x
    Issue #3255904 by jrockowitz: Remove the WebformAssertLegacyTrait
    

  • jrockowitz committed 0c680c7 on 6.1.x
    Issue #3255904 by jrockowitz: Remove the WebformAssertLegacyTrait
    

  • bfc4647 committed on 6.1.x
    Issue #3255904 by jrockowitz: Remove the WebformAssertLegacyTrait
    

  • bfc4647 committed on 6.x
    Issue #3255904 by jrockowitz: Remove the WebformAssertLegacyTrait
    

Status: Fixed » Closed (fixed)

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