mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00: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) {
|
public function writeInfo($title, $subtitle, $description=false) {
|
||||||
echo '<div class="info">';
|
echo '<div class="info">';
|
||||||
echo "<h1>" . Convert::raw2xml($title) . "</h1>";
|
echo "<h1>" . Convert::raw2xml($title) . "</h1>";
|
||||||
echo "<h3>" . Convert::raw2xml($subtitle) . "</h3>";
|
if($subtitle) echo "<h3>" . Convert::raw2xml($subtitle) . "</h3>";
|
||||||
if ($description) {
|
if ($description) {
|
||||||
echo "<p>$description</p>";
|
echo "<p>$description</p>";
|
||||||
} else {
|
} else {
|
||||||
|
@ -79,18 +79,27 @@ class TestRunner extends Controller {
|
|||||||
*/
|
*/
|
||||||
function browse() {
|
function browse() {
|
||||||
self::$default_reporter->writeHeader();
|
self::$default_reporter->writeHeader();
|
||||||
echo '<div class="info">';
|
self::$default_reporter->writeInfo('Available Tests', false);
|
||||||
echo '<h1>Available Tests</h1>';
|
if(Director::is_cli()) {
|
||||||
echo '</div>';
|
$tests = ClassInfo::subclassesFor('SapphireTest');
|
||||||
echo '<div class="trace">';
|
$relativeLink = Director::makeRelative($this->Link());
|
||||||
$tests = ClassInfo::subclassesFor('SapphireTest');
|
echo "sake {$relativeLink}all: Run all " . count($tests) . " tests\n";
|
||||||
echo "<h3><a href=\"" . $this->Link() . "all\">Run all " . count($tests) . " tests</a></h3>";
|
echo "sake {$relativeLink}coverage: Runs all tests and make test coverage report\n";
|
||||||
echo "<h3><a href=\"" . $this->Link() . "coverage\">Runs all tests and make test coverage report</a></h3>";
|
foreach ($tests as $test) {
|
||||||
echo "<hr />";
|
echo "sake {$relativeLink}$test: Run $test\n";
|
||||||
foreach ($tests as $test) {
|
}
|
||||||
echo "<h3><a href=\"" . $this->Link() . "$test\">Run $test</a></h3>";
|
} 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();
|
self::$default_reporter->writeFooter();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user