Commit b8d89f6b authored by catch's avatar catch
Browse files

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

parent 01bd5804
......@@ -42,10 +42,11 @@ protected function addTestsBySuiteNamespace($root, $suite_namespace) {
// to this is Unit tests for historical reasons.
if ($suite_namespace == 'Unit') {
$tests = TestDiscovery::scanDirectory("Drupal\\Tests\\", "$root/core/tests/Drupal/Tests");
$tests = array_filter($tests, function ($test) use ($root) {
// The Listeners directory does not contain tests.
return !preg_match("@^$root/core/tests/Drupal/Tests/Listeners(/|$)@", dirname($test));
});
$tests = array_flip(array_filter(array_flip($tests), function ($test_class) {
// The Listeners directory does not contain tests. Use the class name
// to be compatible with all operating systems.
return !preg_match('/^Drupal\\\\Tests\\\\Listeners\\\\/', $test_class);
}));
$this->addTestFiles($tests);
}
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