Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment | File | Size | Author |
---|---|---|---|
#2 | 3255904-2.patch | 2.89 KB | jrockowitz |
Issue fork webform-3255904
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:
Comments
Comment #2
jrockowitz CreditAttribution: jrockowitz as a volunteer and at Webform module Open Collective, The Big Blue House commentedThe attached patch replaces the WebformAssertLegacyTrait with the deprecated AssertLegacyTrait;
Comment #3
jrockowitz CreditAttribution: jrockowitz as a volunteer and at Webform module Open Collective, The Big Blue House commentedComment #5
jrockowitz CreditAttribution: jrockowitz as a volunteer and at Webform module Open Collective, The Big Blue House commentedAfter the clean-up, we should replace WebformAssertLegacyTrait with the deprecated AssertLegacyTrait.
Comment #6
jrockowitz CreditAttribution: jrockowitz as a volunteer and at Webform module Open Collective, The Big Blue House commentedComment #8
jrockowitz CreditAttribution: jrockowitz as a volunteer and at Webform module Open Collective, The Big Blue House commentedComment #11
jrockowitz CreditAttribution: jrockowitz as a volunteer and at Webform module Open Collective, The Big Blue House commentedComment #12
jrockowitz CreditAttribution: jrockowitz as a volunteer and at Webform module Open Collective, The Big Blue House commented