2010-10-19 05:36:48 +02:00
|
|
|
<?php
|
2010-10-19 05:41:34 +02:00
|
|
|
@require_once('sapphire/tests/bootstrap.php');
|
2010-10-19 05:36:48 +02:00
|
|
|
|
|
|
|
class FullTestSuite {
|
2010-10-19 05:47:39 +02:00
|
|
|
|
2010-10-19 05:36:48 +02:00
|
|
|
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]);
|
|
|
|
}
|
|
|
|
}
|
2010-10-19 05:47:39 +02:00
|
|
|
|
2010-10-19 05:36:48 +02:00
|
|
|
return $tests;
|
|
|
|
}
|
|
|
|
|
2010-10-19 05:47:39 +02:00
|
|
|
public static function suite() {
|
|
|
|
$suite = new PHPUnit_Framework_TestSuite();
|
2010-10-19 05:36:48 +02:00
|
|
|
$classList = self::get_tests();
|
2010-10-19 05:47:39 +02:00
|
|
|
foreach($classList as $className) {
|
2010-10-19 05:36:48 +02:00
|
|
|
$suite->addTest(new SapphireTestSuite($className));
|
|
|
|
}
|
|
|
|
|
2010-10-19 05:47:39 +02:00
|
|
|
return $suite;
|
|
|
|
}
|
2010-10-19 05:36:48 +02:00
|
|
|
}
|
|
|
|
|