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
After we drop support for PHPUnit 4.8, we can remove any BC layer for PHPUnit 4 from PhpunitCompatibilityTrait
as well.
Proposed resolution
Do it.
Remaining tasks
Nope.
User interface changes
Nope.
API changes
Nope.
Data model changes
Nope.
Release notes snippet
Nope.
Comment | File | Size | Author |
---|---|---|---|
#11 | 3053417-11.patch | 9.34 KB | Lendude |
Comments
Comment #2
amateescu CreditAttribution: amateescu for Pfizer, Inc. commentedHere's a patch for this. The combined one includes #3008870: Drop support for PHPUnit 4.8 once PHP 5 is no longer supported (8.8.x).
Comment #4
xjmAre we sure we want to do this as a full removal? We're likely going to need the ability to bridge two PHPUnit versions again in the future because of their very aggressive release cycle vs. our LTSes.
Comment #5
xjmComment #6
LendudeRemoving this BC layer will break existing tests, see #2. We can however remove
\Drupal\Tests\PhpunitCompatibilityTrait::createMock
since the forward compatibility part is no longer needed.Removing the BC part sounds like D9 territory to me.
Comment #7
amateescu CreditAttribution: amateescu for Pfizer, Inc. commentedAgreed with #6. We can also remove some BC code that's not needed anymore from the other methods of the trait.
Comment #9
LendudeWe can simplify the test (a lot). Something like this maybe?
Comment #10
mondrakeWill certainly need a reroll.
+1 for #6, createMock is a fully PHPUnit only method now, no purpose to keep it nor test it.
Duplicated dot at the end.
Other than that, it'd be RTBC from my POV.
Comment #11
Lendude@mondrake thanks for looking at this!
Rerolled, removed the dot, simplified a little more. No interdiff because of reroll.
Comment #12
mondrakeThanks! RTBC.
BTW do we want to tackle
setExpectedException
at any point? It's a BC shim too. Can be a separate issue anyway, and one may argue it's a pretty useful method to keep regardless of PHPUnit dropping it.Comment #13
mondrakeUpdated IS, added this issue to the PHPUnit4 drop support CR.
Comment #14
alexpottCommitted d1ffb5b and pushed to 8.8.x. Thanks!
Definitely seems worth it to file a follow-up to deprecate \Drupal\Tests\PhpunitCompatibilityTrait::setExpectedException() and replace that with PHUnit 6 code.
Comment #16
mondrakeFiled #3059090: Deprecate \Drupal\Tests\PhpunitCompatibilityTrait::setExpectedException().