Commit 4352db07 authored by catch's avatar catch

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) {
// 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_filter($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);
}, ARRAY_FILTER_USE_KEY);
$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