histogram: Make histograms crash less
[ninja.git] / application / views / kohana_unit_test.php
blobc2a98adc87b0a36a6b3a8dadc06fa09a0c01954e
1 <?php defined('SYSPATH') OR die('No direct access allowed.'); ?>
2 <style type="text/css">
3 #kohana-unit-test
5 font-family: Monaco, 'Courier New';
6 background-color: #F8FFF8;
7 margin-top: 20px;
8 clear: both;
9 padding: 10px 10px 0;
10 border: 1px solid #E5EFF8;
11 text-align: left;
13 #kohana-unit-test pre
15 margin: 0;
16 font: inherit;
18 #kohana-unit-test table
20 font-size: 1.0em;
21 color: #4D6171;
22 width: 100%;
23 border-collapse: collapse;
24 border-top: 1px solid #E5EFF8;
25 border-right: 1px solid #E5EFF8;
26 border-left: 1px solid #E5EFF8;
27 margin-bottom: 10px;
29 #kohana-unit-test th
31 text-align: left;
32 border-bottom: 1px solid #E5EFF8;
33 background-color: #263038;
34 padding: 3px;
35 color: #FFF;
37 #kohana-unit-test td
39 background-color: #FFF;
40 border-bottom: 1px solid #E5EFF8;
41 padding: 3px;
43 #kohana-unit-test .k-stats
45 font-weight: normal;
46 color: #83919C;
47 text-align: right;
49 #kohana-unit-test .k-debug
51 padding: 3px;
52 background-color: #FFF0F0;
53 border: 1px solid #FFD0D0;
54 border-right-color: #FFFBFB;
55 border-bottom-color: #FFFBFB;
56 color: #83919C;
58 #kohana-unit-test .k-altrow td
60 background-color: #F7FBFF;
62 #kohana-unit-test .k-name
64 width: 25%;
65 border-right: 1px solid #E5EFF8;
67 #kohana-unit-test .k-passed
69 background-color: #E0FFE0;
71 #kohana-unit-test .k-altrow .k-passed
73 background-color: #D0FFD0;
75 #kohana-unit-test .k-failed
77 background-color: #FFE0E0;
79 #kohana-unit-test .k-altrow .k-failed
81 background-color: #FFD0D0;
83 #kohana-unit-test .k-error
85 background-color: #FFFFE0;
87 #kohana-unit-test .k-altrow .k-error
89 background-color: #FFFFD1;
91 </style>
93 <div id="kohana-unit-test">
95 <?php
97 foreach ($results as $class => $methods):
98 text::alternate();
102 <table>
103 <tr>
104 <th><?php echo $class ?></th>
105 <th class="k-stats">
106 <?php printf('%s: %.2f%%', Kohana::lang('unit_test.score'), $stats[$class]['score']) ?> |
107 <?php echo Kohana::lang('unit_test.total'), ': ', $stats[$class]['total'] ?>,
108 <?php echo Kohana::lang('unit_test.passed'), ': ', $stats[$class]['passed'] ?>,
109 <?php echo Kohana::lang('unit_test.failed'), ': ', $stats[$class]['failed'] ?>,
110 <?php echo Kohana::lang('unit_test.errors'), ': ', $stats[$class]['errors'] ?>
111 </th>
112 </tr>
114 <?php if (empty($methods)): ?>
116 <tr>
117 <td colspan="2"><?php echo Kohana::lang('unit_test.no_tests_found') ?></td>
118 </tr>
120 <?php else:
122 foreach ($methods as $method => $result):
124 // Hide passed tests from report
125 if ($result === TRUE AND $hide_passed === TRUE)
126 continue;
130 <tr class="<?php echo text::alternate('', 'k-altrow') ?>">
131 <td class="k-name"><?php echo $method ?></td>
133 <?php if ($result === TRUE): ?>
135 <td class="k-passed"><strong><?php echo Kohana::lang('unit_test.passed') ?></strong></td>
137 <?php elseif ($result instanceof Kohana_Unit_Test_Exception): ?>
139 <td class="k-failed">
140 <strong><?php echo Kohana::lang('unit_test.failed') ?></strong>
141 <pre><?php echo html::specialchars($result->getMessage()) ?></pre>
142 <?php echo html::specialchars($result->getFile()) ?> (<?php echo Kohana::lang('unit_test.line') ?>&nbsp;<?php echo $result->getLine() ?>)
144 <?php if ($result->getDebug() !== NULL): ?>
145 <pre class="k-debug" title="Debug info"><?php echo '(', gettype($result->getDebug()), ') ', html::specialchars(var_export($result->getDebug(), TRUE)) ?></pre>
146 <?php endif ?>
148 </td>
150 <?php elseif ($result instanceof Exception): ?>
152 <td class="k-error">
153 <strong><?php echo Kohana::lang('unit_test.error') ?></strong>
154 <pre><?php echo html::specialchars($result->getMessage()) ?></pre>
155 <?php echo html::specialchars($result->getFile()) ?> (<?php echo Kohana::lang('unit_test.line') ?>&nbsp;<?php echo $result->getLine() ?>)
156 </td>
158 <?php endif ?>
160 </tr>
162 <?php endforeach ?>
164 <?php endif ?>
166 </table>
168 <?php endforeach ?>
170 </div>