Commit 4352db07 authored by catch's avatar catch
Browse files

Issue #2932715 by mondrake, alexpott, vaplas: PHPUnit testing fails on Windows since #2928249

parent 65b232a8
...@@ -42,10 +42,11 @@ protected function addTestsBySuiteNamespace($root, $suite_namespace) { ...@@ -42,10 +42,11 @@ protected function addTestsBySuiteNamespace($root, $suite_namespace) {
// to this is Unit tests for historical reasons. // to this is Unit tests for historical reasons.
if ($suite_namespace == 'Unit') { if ($suite_namespace == 'Unit') {
$tests = TestDiscovery::scanDirectory("Drupal\\Tests\\", "$root/core/tests/Drupal/Tests"); $tests = TestDiscovery::scanDirectory("Drupal\\Tests\\", "$root/core/tests/Drupal/Tests");
$tests = array_filter($tests, function ($test) use ($root) { $tests = array_filter($tests, function ($test_class) {
// The Listeners directory does not contain tests. // The Listeners directory does not contain tests. Use the class name
return !preg_match("@^$root/core/tests/Drupal/Tests/Listeners(/|$)@", dirname($test)); // to be compatible with all operating systems.
}); return !preg_match('/^Drupal\\\\Tests\\\\Listeners\\\\/', $test_class);
}, ARRAY_FILTER_USE_KEY);
$this->addTestFiles($tests); $this->addTestFiles($tests);
} }
else { else {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment