Closed (fixed)
Project:
Drupal core
Version:
main
Component:
phpunit
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
25 Jan 2026 at 00:47 UTC
Updated:
2 Apr 2026 at 13:25 UTC
Jump to comment: Most recent
Comments
Comment #3
dcam commentedComment #4
dcam commentedComment #5
smustgrave commentedKinda like the others I applied the MR
1. Checked that all instances of any() are gone - They are
2. Check the instances of createMock() to see if they can be stubs, there were 5 instances left in Field and they seem to be valid as they call specific functions with specific returns.
Think this one is good to go.
Comment #6
dcam commentedNeeds work due to PHPUnit 12.5.11 and a new deprecation.
Comment #7
dcam commentedNew development: stubs cannot set
with(). The IS and MR have been updated.Comment #8
smustgrave commentedSorry appears to need a rebase, probably since a few landed this morning!!
Comment #9
dcam commentedRebased
Comment #10
smustgrave commentedFollowed the steps and without the MR I get
Tests: 19, Assertions: 77, PHPUnit Notices: 19.
Running with the MR I got 3 more notices
Test Triggered PHPUnit Notice (Drupal\Tests\field\Unit\FieldUninstallValidatorTest::testValidateDeleted)
Test Triggered PHPUnit Notice (Drupal\Tests\field\Unit\FieldUninstallValidatorTest::testValidateNoStorages)
Comment #11
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 #12
smustgrave commentedApplied the MR from that issue and all notices go away. Thanks for pointing that out.
Comment #13
catchCommitted/pushed to main and 11.x, thanks!
Comment #19
catch11.x wasn't happy with this. Leaving on main.