BUGFIX Failing in TestRunner->init() when PHPUnit is not present, not only in specific method invocations. Previously it was missing checks on only() method

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@77704 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2009-05-25 02:29:05 +00:00
parent 86388328a1
commit 9c10166381

View File

@ -54,6 +54,10 @@ class TestRunner extends Controller {
parent::init();
ManifestBuilder::load_test_manifest();
if (!self::$default_reporter) self::set_reporter(Director::is_cli() ? 'CliDebugView' : 'DebugView');
if(!hasPhpUnit()) {
die("Please install PHPUnit using pear"));
}
}
public function Link() {
@ -63,16 +67,12 @@ class TestRunner extends Controller {
/**
* Run all test classes
*/
function all() {
if(hasPhpUnit()) {
$tests = ClassInfo::subclassesFor('SapphireTest');
array_shift($tests);
unset($tests['FunctionalTest']);
$this->runTests($tests);
} else {
echo "Please install PHPUnit using pear";
}
function all() {
$tests = ClassInfo::subclassesFor('SapphireTest');
array_shift($tests);
unset($tests['FunctionalTest']);
$this->runTests($tests);
}
/**
@ -106,16 +106,12 @@ class TestRunner extends Controller {
}
function coverage() {
if(hasPhpUnit()) {
ManifestBuilder::load_all_classes();
$tests = ClassInfo::subclassesFor('SapphireTest');
array_shift($tests);
unset($tests['FunctionalTest']);
$this->runTests($tests, true);
} else {
echo "Please install PHPUnit using pear";
}
ManifestBuilder::load_all_classes();
$tests = ClassInfo::subclassesFor('SapphireTest');
array_shift($tests);
unset($tests['FunctionalTest']);
$this->runTests($tests, true);
}
function cleanupdb() {