Various minor visual enhancements for Sapphire test report

This commit is contained in:
Saophalkun Ponlu 2012-09-01 11:58:52 +12:00
parent 1629a856de
commit 60987acbdb
5 changed files with 17 additions and 8 deletions

View File

@ -10,7 +10,10 @@ body { background-color: #eee; margin: 0; overflow-x: hidden; padding: 0; font-f
.header { margin: 0; border-bottom: 6px solid #ccdef3; height: 23px; background-color: #666673; padding: 4px 0 2px 6px; }
.trace, .build, .options { padding: 6px 12px; }
.trace .test-case { font-size: 1.1em; }
.trace li, .build li, .options li { font-size: 14px; margin: 6px 0; }
.trace .failure { margin: 1em 0 2em; }
.trace .failure pre { color: #C80700; background: #FFE9E9; border-color: #C80700; }
a { color: #666; }
a:hover { color: #222; }
@ -18,7 +21,7 @@ a:active { color: #111; }
p { margin-bottom: 6px; }
pre { margin-bottom: 20px; background-color: #f5f5f5; border: 1px solid #eee; border: 1px solid rgba(0, 0, 0, 0.08); color: #333; padding: 11px; overflow: auto; -webkit-border-radius: 4px; -moz-border-radius: 4px; -ms-border-radius: 4px; -o-border-radius: 4px; border-radius: 4px; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); }
pre { margin: 1em 0; background-color: #f5f5f5; border: 1px solid #eee; border: 1px solid rgba(0, 0, 0, 0.1); color: #333; padding: 10px 15px; overflow: auto; -webkit-border-radius: 4px; -moz-border-radius: 4px; -ms-border-radius: 4px; -o-border-radius: 4px; border-radius: 4px; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); }
pre span { color: #999; }
pre .error { color: #f00; }
@ -28,6 +31,12 @@ h3 { margin: 0 0 6px 0; color: #333; font-size: 18px; line-height: 24px; }
ul { margin: 0 0 18px 0; padding: 0 0 0 18px; }
.pass { margin-top: 18px; padding: 2px 20px 2px 40px; color: #006600; background: #E2F9E3; border: 1px solid #8DD38D; border-radius: 4px; }
.status { margin-top: 18px; padding: 0; color: #333; background: #EEEEEE; border: 1px solid #CCCCCC; border-radius: 4px; }
.status h2 { margin: 10px 15px; }
.pass { color: #006600; background: #E2F9E3; border-color: #8DD38D; }
.fail { color: #C80700; background: #FFE9E9; border-color: #C80700; }
.fail { margin-top: 18px; padding: 2px 20px 2px 40px; color: #C80700; background: #FFE9E9; border: 1px solid #C80700; border-radius: 4px; }
.message { background-color: white; color: #333; margin: 0.5em; padding: 0.5em 0.8em 0.4em; border: 1px #CCC solid; border-radius: 4px; }
.message.warning { color: #fc7330; background: #fcf5ed; border-color: #fdd0a0; }
.total-time { padding: 0 15px; margin-bottom: 1em; }

View File

@ -159,7 +159,7 @@ class Debug {
if($showHeader) echo "Debug (line $caller[line] of $file):\n ";
echo $message . "\n";
} else {
echo "<p style=\"background-color: white; color: black; width: 95%; margin: 0.5em; padding: 0.3em; border: 1px #CCC solid\">\n";
echo "<p class=\"message warning\">\n";
if($showHeader) echo "<b>Debug (line $caller[line] of $file):</b>\n ";
echo Convert::raw2xml($message) . "</p>\n";
}

View File

@ -78,7 +78,7 @@ class DebugView extends Object {
$pathLinks[] = "<a href=\"$base$pathPart\">$part</a>";
}
}
return implode('&rarr;&nbsp;', $pathLinks);
return implode('&nbsp;&rarr;&nbsp;', $pathLinks);
}
/**

View File

@ -293,8 +293,8 @@ class SapphireTestReporter implements PHPUnit_Framework_TestListener {
}
if ($test['status'] != 1) {
echo "<div class=\"failure\"><span>&otimes; ". $this->testNameToPhrase($test['name']) ."</span><br>";
echo "<pre>".htmlentities($test['message'], ENT_COMPAT, 'UTF-8')."</pre><br>";
echo "<div class=\"failure\"><h2 class=\"test-case\">&otimes; ". $this->testNameToPhrase($test['name']) ."</h2>";
echo "<pre>".htmlentities($test['message'], ENT_COMPAT, 'UTF-8')."</pre>";
echo SS_Backtrace::get_rendered_backtrace($test['trace']);
echo "</div>";
}

View File

@ -324,7 +324,7 @@ class TestRunner extends Controller {
$endTime = microtime(true);
if(Director::is_cli()) echo "\n\nTotal time: " . round($endTime-$startTime,3) . " seconds\n";
else echo "<p>Total time: " . round($endTime-$startTime,3) . " seconds</p>\n";
else echo "<p class=\"total-time\">Total time: " . round($endTime-$startTime,3) . " seconds</p>\n";
if(!Director::is_cli()) echo '</div>';