Closed (fixed)
Project:
Drupal core
Version:
main
Component:
phpunit
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
25 Jan 2026 at 00:58 UTC
Updated:
2 Apr 2026 at 13:25 UTC
Jump to comment: Most recent
Comments
Comment #3
dcam commentedComment #4
dcam commentedComment #5
dcam commentedNeeds work due to PHPUnit 12.5.11 and a new deprecation.
Comment #6
dcam commentedNew development: stubs cannot set
with(). The IS and MR have been updated.The use of
any()inMigrateSourceTest::testCount()andMigrateSourceTest::testCountCacheKey()are removed from the scope of this issue. Those instances represent bad tests that will be handled by #3572915: Invalid tests in MigrateSourceTest.Comment #7
dcam commentedPostponing on #3572915: Invalid tests in MigrateSourceTest.
Comment #8
dcam commentedThis is unblocked. NW to figure out what the next step is.
Comment #9
dcam commentedNo further edits were needed beyond a rebase and updating the baseline, but I decided to merge in the changes from #3569415: Convert expectation-less test mocks to stubs - MigrateProcessTestCase since it became smaller in scope with the deletion of migrate_drupal. That issue has been closed as a duplicate.
Comment #10
dcam commentedComment #11
smustgrave commentedTests: 417, Assertions: 1105, PHPUnit Notices: 316.
Ran with the MR and still got about 19 notices with messages to consider running as stubs.
Comment #12
dcam commented@smustgrave These additional notices are a result of mocks created by
UnitTestCase::getStringTranslationStub(), which contrary to the name returns mock objects, not stubs. These notices will be fixed by #3578904: Convert expectation-less test mocks to stubs - UnitTestCase as they are among the over 500 notices caused by that class and warrant special attention.Comment #13
smustgrave commentedApplied the MR from the other issue and did address all.
Comment #15
catchcore/.phpstan-baseline.php had permissions changed in the MR but fixed that locally. I wonder if we can add a lint step to MR pipelines to catch that.
Committed/pushed to main and 11.x, thanks!
Comment #19
catchComment #22
catchReverted from 11.x after a similar backport caused failures running against phpunit 10. We can just commit these to main.