mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
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:
parent
86388328a1
commit
9c10166381
@ -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() {
|
||||
@ -64,15 +68,11 @@ 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";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -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";
|
||||
}
|
||||
}
|
||||
|
||||
function cleanupdb() {
|
||||
|
Loading…
Reference in New Issue
Block a user