Closed (fixed)
Project:
Drupal core
Version:
main
Component:
phpunit
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
18 Mar 2026 at 00:14 UTC
Updated:
7 Apr 2026 at 09:15 UTC
Jump to comment: Most recent
Comments
Comment #3
dcam commentedThe changes to
MetadataBubblingUrlGeneratorTestwere merged into this test because that class is a child ofUrlGeneratorTest. They need to go in together.Comment #4
dcam commentedComment #5
dcam commentedFYI: the recently-committed
UnitTestCasechanges have been merged into this MR, so they do not need to be applied separately for testing.Comment #6
smustgrave commentedDatabase = OK (160 tests, 194 assertions)
Routing = OK (115 tests, 358 assertions)
All instances of any() appear replaced. Only one I wasn't 100% sure on was core/tests/Drupal/Tests/Core/Routing/RouteBuilderTest.php and the use of new functions. But based on other issues that have been merged seems inline.
LGTM
Comment #8
catchThe new methods are because it's not possible to set up a mock in ::setUp() then only use it in a subset of tests, because when a test method doesn't use it, the expectations of the mock won't be met. So in those cases it has to be set up in a method. The other way would be to split the test into two classes, so the methods that don't need it get their own setUp() method with different mocks, but that's more churn.
Committed/pushed to main, thanks!