mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
ENHANCEMENT Better CLI output for browsing dev/tests
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@65464 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
c7ff6016b8
commit
c6be7af88f
@ -97,7 +97,7 @@ class DebugView {
|
||||
public function writeInfo($title, $subtitle, $description=false) {
|
||||
echo '<div class="info">';
|
||||
echo "<h1>" . Convert::raw2xml($title) . "</h1>";
|
||||
echo "<h3>" . Convert::raw2xml($subtitle) . "</h3>";
|
||||
if($subtitle) echo "<h3>" . Convert::raw2xml($subtitle) . "</h3>";
|
||||
if ($description) {
|
||||
echo "<p>$description</p>";
|
||||
} else {
|
||||
|
@ -79,18 +79,27 @@ class TestRunner extends Controller {
|
||||
*/
|
||||
function browse() {
|
||||
self::$default_reporter->writeHeader();
|
||||
echo '<div class="info">';
|
||||
echo '<h1>Available Tests</h1>';
|
||||
echo '</div>';
|
||||
echo '<div class="trace">';
|
||||
$tests = ClassInfo::subclassesFor('SapphireTest');
|
||||
echo "<h3><a href=\"" . $this->Link() . "all\">Run all " . count($tests) . " tests</a></h3>";
|
||||
echo "<h3><a href=\"" . $this->Link() . "coverage\">Runs all tests and make test coverage report</a></h3>";
|
||||
echo "<hr />";
|
||||
foreach ($tests as $test) {
|
||||
echo "<h3><a href=\"" . $this->Link() . "$test\">Run $test</a></h3>";
|
||||
self::$default_reporter->writeInfo('Available Tests', false);
|
||||
if(Director::is_cli()) {
|
||||
$tests = ClassInfo::subclassesFor('SapphireTest');
|
||||
$relativeLink = Director::makeRelative($this->Link());
|
||||
echo "sake {$relativeLink}all: Run all " . count($tests) . " tests\n";
|
||||
echo "sake {$relativeLink}coverage: Runs all tests and make test coverage report\n";
|
||||
foreach ($tests as $test) {
|
||||
echo "sake {$relativeLink}$test: Run $test\n";
|
||||
}
|
||||
} else {
|
||||
echo '<div class="trace">';
|
||||
$tests = ClassInfo::subclassesFor('SapphireTest');
|
||||
echo "<h3><a href=\"" . $this->Link() . "all\">Run all " . count($tests) . " tests</a></h3>";
|
||||
echo "<h3><a href=\"" . $this->Link() . "coverage\">Runs all tests and make test coverage report</a></h3>";
|
||||
echo "<hr />";
|
||||
foreach ($tests as $test) {
|
||||
echo "<h3><a href=\"" . $this->Link() . "$test\">Run $test</a></h3>";
|
||||
}
|
||||
echo '</div>';
|
||||
}
|
||||
echo '</div>';
|
||||
|
||||
self::$default_reporter->writeFooter();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user