Closed (fixed)
Project:
Drupal core
Version:
main
Component:
phpunit
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
23 Mar 2026 at 21:04 UTC
Updated:
10 Apr 2026 at 16:20 UTC
Jump to comment: Most recent
Comments
Comment #2
dcam commentedAnd apparently I didn't fix the local task tests like I thought I had. That fix must have gotten lost long the way. So I get to recreate it, which I think was kind of problematic. Joy.
Comment #4
dcam commentedComment #5
dcam commentedOutput of running Core module kernel tests:
Comment #6
dcam commentedOutput of running
core/tests/Drupal/KernelTests:Comment #7
dcam commentedMeh. There's enough kernel tests with issues that they probably ought to be handled separately.
Comment #8
dcam commentedI changed my mind about adding the kernel tests to the MR. Only 16 classes were affected. Most of the changes were incredibly small and straight-forward. Here's the command to run PHPUnit on those classes (it may have to be tweaked for your local environment's setup):
One test is not completely fixed,
core/tests/Drupal/KernelTests/Core/Database/TransactionTest.php. The test's docblock says that it exists solely to ensure that we are capable of creating mock object transactions - and that's all it does. Apparently it needs to create a mock object, but there's no opportunity to check methods unless you add an incredibly unnecessary and blatant dummy assertion. And so, for the first time and at the end of this project I'm going to declare that we need to add the#[AllowMockObjectsWithoutExpectations]attribute to a test. This can't be done with the current version of PHPUnit. It has to be added as part of the PHPUnit 12 upgrade. So if you run the tests looking for notices, then don't worry that it isn't fixed.Comment #9
dcam commentedComment #10
smustgrave commentedSaving this one for last once the others land to do a better search. Most are RTBC but the views one which is a bear.
Comment #11
mondrakeMade a suggestion inline.
Comment #12
dcam commentedIt should be noted that with this MR there are no more instances of
disallowed.methodin the baseline, meaning we got rid of all the uses ofany()that we added to it. 👍Comment #13
smustgrave commentedApplied the MR locally and all instances of any() appear to be replaced in the repo.
I have no additional feedback
Comment #14
mondrakeThere is only one test class failing in #3527936: Introduce support for PHPUnit 12 once this MR is included:
Would it make sense to try and fix it here?
Comment #15
smustgrave commented@dcam did you have a separate issue for the kernel tests?
Comment #16
dcam commentedNo. They're all in this MR. I'll fix the package_manager class now.
Comment #17
dcam commentedIt was a quick fix.
Comment #18
mondrakeThanks
Comment #19
mondrakeA new misusage was just introduced by
Drupal\Tests\language\Unit\ConfigurableLanguageManagerSwitchLinksTest, but at this point I'd rather get this in and fix any stragglers in the PHPUnit 12 bump issue.Comment #20
smustgrave commentedI posted in core-development and think longwave is going to be able to take a look later. I got the phpunit12 tab open and ready to peak after this lands
Comment #21
dcam commentedI have a fix for that class ready on my local env. I can apply it here or in the bump issue.
Comment #22
mondrake#21 there are test failures, probably random - I think it would be good to get the fix here and then trigger new tests. I'll keep an eye on this and re-RTBC asap.
Comment #23
dcam commentedThe new class was added to the MR.
Comment #24
mondrakeSome test failure still, random ones I assume. The latest changes seem good to me.
Comment #25
dcam commentedFWIW those two failed tests pass in my local environment.
Comment #27
catchAll looks good. Thanks once again for the self-review comments.
Committed/pushed to main, thanks! Can't believe this is the last one.
Comment #30
smustgrave commentedCongrats yall!