Closed (fixed)
Project:
Drupal core
Version:
main
Component:
phpunit
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
22 Jul 2026 at 12:17 UTC
Updated:
14 Sep 2026 at 09:30 UTC
Jump to comment: Most recent
In #3611750: Move toolbar integration tests to toolbar module, part 1 I made incorrect namespaces in 5 test files and PhpUnitApiFindAllClassFilesTest.php failed on 11.x but not main.
The problem was discovered when creating an 11.x version for #3611749: Remove toolbar from tests where it is not needed.
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
quietone commentedComment #5
longwaveLocally this finds two tests that aren't discovered.
Comment #6
godotislatePer #3619402-9: Fix olivero AjaxTest directory, let's fix NodeSearchTest here.
Namespace in the file is
Drupal\Tests\search_node\Kernel\node.Path to file is
core/modules/search/modules/search_node/tests/src/node/Kernel/NodeSearchTest.phpI think we should change both and remove "node"?
namespace
Drupal\Tests\search_node\KernelPath to file
core/modules/search/modules/search_node/tests/src/Kernel/NodeSearchTest.phpThis is probably soft-blocked on #3619402: Fix olivero AjaxTest directory.
Comment #7
longwaveRebased since the Olivero fix went in, fixed the node search test here on top, so this is green now.
Comment #8
mondrakeNice test addition. The entire test class is now taking very long to execute, maybe it could be split. But not necessarily here.
Comment #9
catchIs the other method in this test doing anything at all given it's letting broken test classes slip through?
Comment #10
longwaveThe other method is a smoke test that proves that different arguments to test discovery all return at least something. The new test doesn't check any arguments, it only requests "all tests" but then ensures that this matches what's found on the filesystem.
I think they are both worth keeping, the smoke test could be expanded to be more specific but perhaps in a followup.
Comment #11
mondrakeThe other test is a remainder of when we were comparing results of the PHPUnit discovery vs Drupal own test discovery, which is now gone. Now it’s probably overkill as it is testing PHPUnit features, and PHPUnit has its own tests.
Comment #12
catch@mondrake is that why it's failing in 11.x and passing in main? If so I think we should remove that here.
Comment #13
mondrakeWhat’s failing in 11.x? Is there a job to look at?
Comment #14
catch@mondrake in 11.x it finds classes that don't match the namespace, like #3619402: Fix olivero AjaxTest directory, in main it doesn't. What this means is that several times we've committed MRs that move tests around and end up with a mis-matched namespace to main, then only found out when they were backported to 11.x
So 'failing' in the sense of working, in main it only ever seems to pass.
Comment #15
mondrake#14 yes. Since there’s no longer anything to compare against in main where the legacy discovery was removed, the old test is rather irrelevant. The new one readds a list of files to compare against, so it’s more effective. +1 to gut the old test at this point, it’s just confusing.
Comment #16
longwaveI combined the tests so we cover both the "all tests" case and also a small subset (system module kernel tests in the Menu group).
Comment #17
mondrake👍
Comment #19
catchCommitted/pushed to main, thanks!