silverstripe-framework/tests/FullTestSuite.php
Ingo Schommer 628a39cac7 ENHANCEMENT Allowing to run single tests via phpunit through new test bootstrap XML file (e.g. "phpunit sapphire/tests/api/RestfulServerTest.php" or "phpunit sapphire/tests/api")
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@111048 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:19:52 +13:00

35 lines
800 B
PHP

<?php
@require_once('sapphire/tests/bootstrap.php');
class FullTestSuite {
public static function get_tests() {
ManifestBuilder::load_test_manifest();
$tests = ClassInfo::subclassesFor('SapphireTest');
array_shift($tests);
unset($tests['FunctionalTest']);
// Remove tests that don't need to be executed every time
unset($tests['PhpSyntaxTest']);
foreach($tests as $class => $v) {
$reflection = new ReflectionClass($class);
if (!$reflection->isInstantiable()) {
unset($tests[$class]);
}
}
return $tests;
}
public static function suite()
{
$suite = new PHPUnit_Framework_TestSuite();
$classList = self::get_tests();
foreach($classList as $className) {
$suite->addTest(new SapphireTestSuite($className));
}
return $suite;
}
}