BUGFIX Checking for class_exists() when collating testable classes in TestRunner

ENHANCEMENT Removing space from TestRunner header output listing classnames, to make them easier to copy/paste into a custom test run command (which accepts comma-separated arguments, but has trouble with spaces)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@80799 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2009-07-02 00:17:29 +00:00
parent f41e2b474c
commit 54f8ece2e7
1 changed files with 4 additions and 2 deletions

View File

@ -158,7 +158,9 @@ class TestRunner extends Controller {
foreach($moduleNames as $moduleName) {
$classesForModule = ClassInfo::classes_for_folder($moduleName);
if($classesForModule) foreach($classesForModule as $class) {
if(is_subclass_of($class, 'SapphireTest')) $classNames[] = $class;
if(class_exists($class) && is_subclass_of($class, 'SapphireTest')) {
$classNames[] = $class;
}
}
}
@ -202,7 +204,7 @@ class TestRunner extends Controller {
self::$default_reporter->writeHeader("Sapphire Test Runner");
if (count($classList) > 1) {
self::$default_reporter->writeInfo("All Tests", "Running test cases: " . implode(", ", $classList));
self::$default_reporter->writeInfo("All Tests", "Running test cases: " . implode(",", $classList));
} else {
self::$default_reporter->writeInfo($classList[0], "");
}