mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
4a5d9b03f8
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@39001 467b73ca-7a2a-4603-9d3b-597d59a354a9
33 lines
923 B
PHP
Executable File
33 lines
923 B
PHP
Executable File
<?php
|
|
|
|
require_once('unit_tester.php');
|
|
require_once('reporter.php');
|
|
|
|
/**
|
|
* UnitTesting is a wrapper around the "Simple Test" unit testing framework.
|
|
*/
|
|
class UnitTesting extends Controller {
|
|
function index() {
|
|
$test = &new GroupTest("SilverStripe Unit-testing Results for '" . project() . "'");
|
|
$builtins = array('UnitTestCase', 'ShellTestCase', 'WebTestCase','SimpleTestCase');
|
|
|
|
foreach(ClassInfo::subclassesFor("SimpleTestCase") as $testCase) {
|
|
if(!in_array($testCase, $builtins)) {
|
|
$test->addTestCase($cases[] = new $testCase());
|
|
|
|
}
|
|
}
|
|
|
|
$test->run(new HtmlReporter());
|
|
|
|
echo "<h2>What's being tested?</h2>";
|
|
foreach($cases as $testCase) {
|
|
echo "<li style=\"color: " . ($testCase->testComplete?$testCase->testComplete:'orange') . "\"><b>" . get_class($testCase) . ":</b> ";
|
|
echo ($testCase->whatsBeingTested?$testCase->whatsBeingTested:'unknown');
|
|
echo "</li>";
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
?>
|