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
In the test Drupal\Tests\Core\Test\TestDiscoveryTest::testGetTestsInProfiles() an instance of TestDiscovery is created with 3 parameters. The constructor of TestDiscovery only takes 2 parameters.
Proposed resolution
Remove the last parameter in the creation of the instance of TestDiscovery.
Remaining tasks
TBD
User interface changes
None
API changes
None
Data model changes
None
Release notes snippet
None
Comment | File | Size | Author |
---|---|---|---|
#3 | interdiff-2-3.txt | 1.05 KB | TR |
#3 | 3257485-3-testdiscoverytest.patch | 1.93 KB | TR |
|
Comments
Comment #2
daffie CreditAttribution: daffie commentedThe fix.
Comment #3
TR CreditAttribution: TR commentedThis bug was introduced by #2863055: Move TestDiscovery out of simpletest module, minimize dependencies when TestDiscovery was moved out of the simpletest module and into core.
In simpletest, the third argument of the TestDiscovery constructor was the module handler. The module handler was used only for the purpose of implementing hook_simpletest_alter(). When that hook was removed by [#2939892], the module handler was no longer needed, so when TestDiscovery was moved to core that third constructor argument was deliberately removed. This was discussed in #2863055: Move TestDiscovery out of simpletest module, minimize dependencies.
Patch #2 is correct but incomplete. There is one additional place in TestDiscoveryTest where the module handler is passed to the constructor when creating a mock TestDiscovery. Here is a new patch that fixes that as well.
Note that #2863055: Move TestDiscovery out of simpletest module, minimize dependencies was made in D8.8, so this bug exists in both D10 and D9. The patch here does apply to D9 as well, with some offset.
Comment #5
TR CreditAttribution: TR commentedComment #6
TR CreditAttribution: TR commentedComment #7
daffie CreditAttribution: daffie commentedFor @TR, was my patch from comment #2: "Patch #2 is correct but incomplete".
The added changes in the patch from comment #3 look good to me.
For me it is RTBC.
Comment #9
TR CreditAttribution: TR commentedDrupalCI is showing random intermittent failures with layout_builder. These failures are unrelated to this patch. See #3262505: [random test failure] Random error in layout_builder FunctionalJavascript tests
I will continue to re-test to get it to run green, then set the status back to RTBC.
Comment #10
TR CreditAttribution: TR commentedComment #12
daffie CreditAttribution: daffie commentedComment #14
catchCommitted/pushed to 10.0.x and cherry-picked to 9.5.x, thanks!