From a16b7dd6366080bb9262bd76eaa32df5a7c1719b Mon Sep 17 00:00:00 2001 From: Nathaniel Catchpole Date: Thu, 20 Apr 2017 00:06:50 +0100 Subject: [PATCH] Issue #2869120 by penyaskito, Mixologic, Berdir: run-tests.sh ignores classes if they have whitespace before the declaration using --directory --- core/scripts/run-tests.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/scripts/run-tests.sh b/core/scripts/run-tests.sh index 714cf3c46cff..09a7aad57cef 100755 --- a/core/scripts/run-tests.sh +++ b/core/scripts/run-tests.sh @@ -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]); }