The Needs Review Queue Bot → tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".
Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.
Consult the Drupal Contributor Guide → to find step-by-step guides for working with issues.
- 🇮🇳India Nikhil_110
Attached patch against Drupal 10.1.x
Patch #7 is not applied for Drupal 10.1.x so Inter-diff file is not added.
Checking patch core/lib/Drupal/Core/Test/TestDiscovery.php...
error: while searching for:
$this->testNamespaces["Drupal\\$name\\Tests\\"][] = "$base_path/src/Tests";// Add PHPUnit test namespaces.
$this->testNamespaces["Drupal\\Tests\\$name\\Unit\\"][] = "$base_path/tests/src/Unit";
$this->testNamespaces["Drupal\\Tests\\$name\\Kernel\\"][] = "$base_path/tests/src/Kernel";
$this->testNamespaces["Drupal\\Tests\\$name\\Functional\\"][] = "$base_path/tests/src/Functional";
$this->testNamespaces["Drupal\\Tests\\$name\\Build\\"][] = "$base_path/tests/src/Build";
$this->testNamespaces["Drupal\\Tests\\$name\\FunctionalJavascript\\"][] = "$base_path/tests/src/FunctionalJavascript";// Add discovery for traits which are shared between different test
// suites.
$this->testNamespaces["Drupal\\Tests\\$name\\Traits\\"][] = "$base_path/tests/src/Traits";
}foreach ($this->testNamespaces as $prefix => $paths) {
error: patch failed: core/lib/Drupal/Core/Test/TestDiscovery.php:102
error: core/lib/Drupal/Core/Test/TestDiscovery.php: patch does not apply
Checking patch core/tests/bootstrap.php...
Hunk #1 succeeded at 79 (offset -1 lines).
Hunk #2 succeeded at 87 (offset -1 lines). - last update
over 1 year ago 29,204 pass - Status changed to Needs review
over 1 year ago 9:35am 17 April 2023 - Status changed to Needs work
11 months ago 1:36am 11 October 2023 - 🇦🇺Australia craigra
I've tested the patch in #11 on Drupal 10.2 and confirmed that this fixes the issue with test classes being unable to find a helper class under tests/src/Helper within a module test directory, as described in the steps to reproduce. Similarly I've verified this for theme and profile test directories.
What additional work is needed for core test locations (#7), and could this be split to another issue so the existing fix for modules, themes and profiles can be RTBC?
- 🇬🇧United Kingdom longwave UK
I don't actually think we can do much about the core namespaces, because they sit directly under
\Drupal
and we don't want to go looking incore/tests/Drupal
for non-test Drupal code.Converted #11 to an MR, inlined a variable for readability, and updated the IS with the proposed solution.
- Status changed to Needs review
7 months ago 10:45pm 2 March 2024 - Status changed to Needs work
7 months ago 9:41pm 3 March 2024 - Status changed to Needs review
7 months ago 11:21pm 3 March 2024 - Status changed to RTBC
7 months ago 11:42pm 3 March 2024 - 🇬🇧United Kingdom catch
Committed/pushed to 11.x and cherry-picked to 10.3.x, thanks!
- Status changed to Fixed
7 months ago 12:39pm 4 March 2024 Automatically closed - issue fixed for 2 weeks with no activity.