Issue #2869120 by penyaskito, Mixologic, Berdir: run-tests.sh ignores classes if they have whitespace before the declaration using --directory

8.4.x
Nathaniel Catchpole 2017-04-20 00:06:50 +01:00
parent b8ed298cc1
commit a16b7dd636
1 changed files with 2 additions and 2 deletions

View File

@ -1063,12 +1063,12 @@ function simpletest_script_get_test_list() {
$content = file_get_contents($file);
// Extract a potential namespace.
$namespace = FALSE;
if (preg_match('@^namespace ([^ ;]+)@m', $content, $matches)) {
if (preg_match('@^\s*namespace ([^ ;]+)@m', $content, $matches)) {
$namespace = $matches[1];
}
// Extract all class names.
// Abstract classes are excluded on purpose.
preg_match_all('@^class ([^ ]+)@m', $content, $matches);
preg_match_all('@^\s*class ([^ ]+)@m', $content, $matches);
if (!$namespace) {
$test_list = array_merge($test_list, $matches[1]);
}