Skip to content
Browse files

Fixed empty test run reporting color. Added 'Run All Tests' Button. S…

…tyled out test suite menu.
  • Loading branch information...
1 parent a00543d commit b3d0a5eebd60fcf64701c3a8748edc6b65a182dc @indiefan indiefan committed with gwoo Feb 22, 2010
View
41 app/webroot/css/debug.css
@@ -33,6 +33,47 @@ body.test-dashboard h1 {
background: #B5B4A4;
}
+a.test-button, a.test-button:link, a.test-button:visited, a.test-button:hover, a.test-button:active {
+ display: block;
+ margin: 8px 0 15px 0;
+ padding: 8px 10px;
+ border: 2px solid #000000;
+ font-family: Helvetica, Arial, sans-serif;
+ font-weight: bold;
+ font-size: 16px;
+ background-color:#B5B4a4;
+ border-color: #009933;
+ border-radius: 5px;
+ text-align: center;
+ text-decoration: none;
+}
+
+a.test-button:hover, a.test-button:active {
+ background-color: #33CC66;
+}
+
+ul.menu, ul.menu ul {
+ list-style: none;
+}
+
+ul.menu ul {
+ padding-left: 10px;
+}
+
+ul.menu a {
+ text-decoration: none;
+}
+
+ul.menu a:hover, ul.menu a:active {
+ color: #009933;
+}
+
+a.menu-folder {
+ font-weight: bold;
+ text-decoration: none;
+ border-bottom: 1px dashed #ccc;
+}
+
/*--- Benchmarking ---*/
table.metrics {
border: 0;
View
10 libraries/lithium/test/Report.php
@@ -183,11 +183,19 @@ public function stats() {
return $stats;
});
+ $stats = (array) $stats + array(
+ 'asserts' => null,
+ 'passes' => array(),
+ 'fails' => array(),
+ 'errors' => array(),
+ 'exceptions' => array(),
+ 'skips' => array()
+ );
$count = array_map(
function($value) { return is_array($value) ? count($value) : $value; },
$stats
);
- $success = $count['passes'] === $count['asserts'] && $count['errors'] === 0;
+ $success = $count['passes'] == $count['asserts'] && $count['errors'] === 0;
return compact("stats", "count", "success");
}
View
3 libraries/lithium/test/templates/layout.html.php
@@ -14,7 +14,8 @@
<h1>Lithium Unit Test Dashboard</h1>
<div style="float: left; padding: 10px 0 20px 20px; width: 20%;">
- <h2><a href="<?= $base ?>/test/">Tests</a></h2>
+ <h2>Select Test(s):</h2>
+ <a class="test-button" href="<?= $base ?>/test/lithium/tests">Run All Tests</a>
<?= $report->render("menu", array("menu" => $menu, "base" => $base)) ?>
</div>
View
7 libraries/lithium/test/templates/menu.html.php
@@ -3,15 +3,14 @@
$prev = array();
$current = null;
?>
-<ul><li><a href="<?= $base ?>/test/lithium/tests">Run All Tests</a></li>
<?php foreach ($menu as $test): ?>
<?php
$case = array_pop($path = explode("\\", $test));
$caseDepth = count($path);
?>
<?php if (!isset($current)): ?>
- <ul>
+ <ul class="menu">
<?php endif ?>
<?php while ($depth >= $caseDepth): ?>
@@ -32,7 +31,7 @@
<?php while ($depth < $caseDepth-1): ?>
<li>
- <a href="<?= $base ?>/test/<?= join(array_slice($path, 0, $depth+1), "\\") ?>">
+ <a class="menu-folder" href="<?= $base ?>/test/<?= join(array_slice($path, 0, $depth+1), "\\") ?>">
<?= $path[$depth] ?>
</a>
<ul>
@@ -47,7 +46,7 @@
<?php endforeach ?>
-<?php while($depth > 0): ?>
+<?php while($depth > 1): ?>
</li></ul>
<?php $depth--; ?>
<?php endwhile ?>

0 comments on commit b3d0a5e

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