Skip to content
This repository
Browse code

Various minor visual enhancements for Sapphire test report

  • Loading branch information...
commit 60987acbdb3ccab99d5fe3303e86709646b1cf8d 1 parent 1629a85
Saophalkun Ponlu authored September 01, 2012
15  css/debug.css
@@ -10,7 +10,10 @@ body { background-color: #eee; margin: 0; overflow-x: hidden; padding: 0; font-f
10 10
 .header { margin: 0; border-bottom: 6px solid #ccdef3; height: 23px; background-color: #666673; padding: 4px 0 2px 6px; }
11 11
 
12 12
 .trace, .build, .options { padding: 6px 12px; }
  13
+.trace .test-case { font-size: 1.1em; }
13 14
 .trace li, .build li, .options li { font-size: 14px; margin: 6px 0; }
  15
+.trace .failure { margin: 1em 0 2em; }
  16
+.trace .failure pre { color: #C80700; background: #FFE9E9; border-color: #C80700; }
14 17
 
15 18
 a { color: #666; }
16 19
 a:hover { color: #222; }
@@ -18,7 +21,7 @@ a:active { color: #111; }
18 21
 
19 22
 p { margin-bottom: 6px; }
20 23
 
21  
-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); }
  24
+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); }
22 25
 pre span { color: #999; }
23 26
 pre .error { color: #f00; }
24 27
 
@@ -28,6 +31,12 @@ h3 { margin: 0 0 6px 0; color: #333; font-size: 18px; line-height: 24px; }
28 31
 
29 32
 ul { margin: 0 0 18px 0; padding: 0 0 0 18px; }
30 33
 
31  
-.pass { margin-top: 18px; padding: 2px 20px 2px 40px; color: #006600; background: #E2F9E3; border: 1px solid #8DD38D; border-radius: 4px; }
  34
+.status { margin-top: 18px; padding: 0; color: #333; background: #EEEEEE; border: 1px solid #CCCCCC; border-radius: 4px; }
  35
+.status h2 { margin: 10px 15px; }
  36
+.pass { color: #006600; background: #E2F9E3; border-color: #8DD38D; }
  37
+.fail { color: #C80700; background: #FFE9E9; border-color: #C80700; }
32 38
 
33  
-.fail { margin-top: 18px; padding: 2px 20px 2px 40px; color: #C80700; background: #FFE9E9; border: 1px solid #C80700; border-radius: 4px; }
  39
+.message { background-color: white; color: #333; margin: 0.5em; padding: 0.5em 0.8em 0.4em; border: 1px #CCC solid; border-radius: 4px; }
  40
+.message.warning { color: #fc7330; background: #fcf5ed; border-color: #fdd0a0; }
  41
+
  42
+.total-time { padding: 0 15px; margin-bottom: 1em; }
2  dev/Debug.php
@@ -159,7 +159,7 @@ static function message($message, $showHeader = true) {
159 159
 				if($showHeader) echo "Debug (line $caller[line] of $file):\n ";
160 160
 				echo $message . "\n";
161 161
 			} else {
162  
-				echo "<p style=\"background-color: white; color: black; width: 95%; margin: 0.5em; padding: 0.3em; border: 1px #CCC solid\">\n";
  162
+				echo "<p class=\"message warning\">\n";
163 163
 				if($showHeader) echo "<b>Debug (line $caller[line] of $file):</b>\n ";
164 164
 				echo Convert::raw2xml($message) . "</p>\n";
165 165
 			}
2  dev/DebugView.php
@@ -78,7 +78,7 @@ public function Breadcrumbs() {
78 78
 				$pathLinks[] = "<a href=\"$base$pathPart\">$part</a>";
79 79
 			}
80 80
 		}
81  
-		return implode('&rarr;&nbsp;', $pathLinks);
  81
+		return implode('&nbsp;&rarr;&nbsp;', $pathLinks);
82 82
 	}	
83 83
 	
84 84
 	/**
4  dev/SapphireTestReporter.php
@@ -293,8 +293,8 @@ public function writeResults() {
293 293
 				}
294 294
 
295 295
 				if ($test['status'] != 1) {
296  
-					echo "<div class=\"failure\"><span>&otimes; ". $this->testNameToPhrase($test['name']) ."</span><br>";
297  
-					echo "<pre>".htmlentities($test['message'], ENT_COMPAT, 'UTF-8')."</pre><br>";
  296
+					echo "<div class=\"failure\"><h2 class=\"test-case\">&otimes; ". $this->testNameToPhrase($test['name']) ."</h2>";
  297
+					echo "<pre>".htmlentities($test['message'], ENT_COMPAT, 'UTF-8')."</pre>";
298 298
 					echo SS_Backtrace::get_rendered_backtrace($test['trace']);
299 299
 					echo "</div>";
300 300
 				}
2  dev/TestRunner.php
@@ -324,7 +324,7 @@ class_exists($className);
324 324
 
325 325
 		$endTime = microtime(true);
326 326
 		if(Director::is_cli()) echo "\n\nTotal time: " . round($endTime-$startTime,3) . " seconds\n";
327  
-		else echo "<p>Total time: " . round($endTime-$startTime,3) . " seconds</p>\n";
  327
+		else echo "<p class=\"total-time\">Total time: " . round($endTime-$startTime,3) . " seconds</p>\n";
328 328
 		
329 329
 		if(!Director::is_cli()) echo '</div>';
330 330
 		

0 notes on commit 60987ac

Please sign in to comment.
Something went wrong with that request. Please try again.