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
The field assertions in AssertLegacyTrait do not have proper test coverage. This makes changing the behavior very difficult.
Proposed resolution
Add 100% coverage for the assertions.
User interface changes
None.
API changes
None.
Data model changes
None.
Comment | File | Size | Author |
---|---|---|---|
#11 | 2876357-11.patch | 11.88 KB | michielnugter |
#11 | interdiff-9-11.txt | 1.53 KB | michielnugter |
#9 | 2876357-9.patch | 11.63 KB | michielnugter |
#9 | interdiff-2-9.txt | 2.6 KB | michielnugter |
#2 | 2876357-2.patch | 10.64 KB | michielnugter |
Comments
Comment #2
michielnugter CreditAttribution: michielnugter as a volunteer and at Synetic commentedPatch is based on 2868019-47.patch. Interdiff is between these patches.
Thanks to @jonathan1055 for helping on the coverage. Don't forget to credit him on this issue!
Comment #3
michielnugter CreditAttribution: michielnugter as a volunteer and at Synetic commentedComment #4
michielnugter CreditAttribution: michielnugter as a volunteer and at Synetic commentedSelf/jonathan1055 review:
Still missing:
- Negative assertFieldChecked test coverage
- assertOptionSelected positive and negative coverage
Let's not add code that's out of scope for the issue:
Comment #6
jonathan1055 CreditAttribution: jonathan1055 as a volunteer commentedGood idea to split this off. I had thought about doing that before.
The test failure is nothing to do with our changes - seems core codebase has had a commit which fails the views tests.
[edit: I did not intend to set the status to 'needs review' it just stayed that way from before]
Comment #7
michielnugter CreditAttribution: michielnugter as a volunteer and at Synetic commentedWell, the fail wasn't related so a Review would be nice :)
Comment #8
LendudeLittle more to add then the self review in #4, so
The expected fails for these two assertions. There is a test for a non-existent id, but more interesting would be a test using the other (existing) checkbox, so expected failing tests for:
and coverage for:
- assertOption
- assertOptionSelected
Comment #9
michielnugter CreditAttribution: michielnugter as a volunteer and at Synetic commentedGood one! Added it to the current patch. I think we have full coverage for the field related methods now, rest of the review comments have been addressed as well.
Comment #10
Lendudesame as for the checkboxes, could we use an option that does exist but isn't selected.
comments don't match the test.
Comment #11
michielnugter CreditAttribution: michielnugter as a volunteer and at Synetic commentedGood ones, really should start paying attention to the copy-paste comments ;)
Review processed, ready for review again.
Comment #12
LendudeAll green, all feedback addressed.
Comment #13
alexpottCommitted and pushed c6b88ca to 8.4.x and 6775d02 to 8.3.x. Thanks!
Really nice to see all this additional coverage.