From 60987acbdb3ccab99d5fe3303e86709646b1cf8d Mon Sep 17 00:00:00 2001 From: Saophalkun Ponlu Date: Sat, 1 Sep 2012 11:58:52 +1200 Subject: [PATCH] Various minor visual enhancements for Sapphire test report --- css/debug.css | 15 ++++++++++++--- dev/Debug.php | 2 +- dev/DebugView.php | 2 +- dev/SapphireTestReporter.php | 4 ++-- dev/TestRunner.php | 2 +- 5 files changed, 17 insertions(+), 8 deletions(-) diff --git a/css/debug.css b/css/debug.css index f4be9277d..ba81c7062 100644 --- a/css/debug.css +++ b/css/debug.css @@ -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; } \ No newline at end of file diff --git a/dev/Debug.php b/dev/Debug.php index fb48b5544..0daca85c7 100644 --- a/dev/Debug.php +++ b/dev/Debug.php @@ -159,7 +159,7 @@ class Debug { if($showHeader) echo "Debug (line $caller[line] of $file):\n "; echo $message . "\n"; } else { - echo "

\n"; + echo "

\n"; if($showHeader) echo "Debug (line $caller[line] of $file):\n "; echo Convert::raw2xml($message) . "

\n"; } diff --git a/dev/DebugView.php b/dev/DebugView.php index 7358bb870..ce422e151 100644 --- a/dev/DebugView.php +++ b/dev/DebugView.php @@ -78,7 +78,7 @@ class DebugView extends Object { $pathLinks[] = "$part"; } } - return implode('→ ', $pathLinks); + return implode(' → ', $pathLinks); } /** diff --git a/dev/SapphireTestReporter.php b/dev/SapphireTestReporter.php index 496b4d004..d5c8e766e 100644 --- a/dev/SapphireTestReporter.php +++ b/dev/SapphireTestReporter.php @@ -293,8 +293,8 @@ class SapphireTestReporter implements PHPUnit_Framework_TestListener { } if ($test['status'] != 1) { - echo "
⊗ ". $this->testNameToPhrase($test['name']) ."
"; - echo "
".htmlentities($test['message'], ENT_COMPAT, 'UTF-8')."

"; + echo "

⊗ ". $this->testNameToPhrase($test['name']) ."

"; + echo "
".htmlentities($test['message'], ENT_COMPAT, 'UTF-8')."
"; echo SS_Backtrace::get_rendered_backtrace($test['trace']); echo "
"; } diff --git a/dev/TestRunner.php b/dev/TestRunner.php index 8038a8cb1..8b89031ea 100644 --- a/dev/TestRunner.php +++ b/dev/TestRunner.php @@ -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 "

Total time: " . round($endTime-$startTime,3) . " seconds

\n"; + else echo "

Total time: " . round($endTime-$startTime,3) . " seconds

\n"; if(!Director::is_cli()) echo '
';