1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
<?php defined('SYSPATH') OR die('No direct access allowed.');
foreach ($results as $class => $methods)
{
echo "\n\n" . Kohana::lang('unit_test.class') . ': ' . $class . "\n\n";
printf('%s: %.2f%%', Kohana::lang('unit_test.score'), $stats[$class]['score']);
echo ",\n" . Kohana::lang('unit_test.total'), ': ', $stats[$class]['total'] . ",\n";
echo Kohana::lang('unit_test.passed'), ': ', $stats[$class]['passed'] . ",\n";
echo Kohana::lang('unit_test.failed'), ': ', $stats[$class]['failed'] . ",\n";
echo Kohana::lang('unit_test.errors'), ': ', $stats[$class]['errors'] . "\n\n";
if (empty($methods))
{
echo Kohana::lang('unit_test.no_tests_found');
}
else
{
foreach ($methods as $method => $result)
{
// Hide passed tests from report
if ($result === TRUE AND $hide_passed === TRUE)
continue;
echo Kohana::lang('unit_test.method') . ': ' . $method . ': ';
if ($result === TRUE)
{
echo Kohana::lang('unit_test.passed') . "\n";
}
else
{
echo Kohana::lang('unit_test.failed') . "\n\t" . $result->getMessage() . "\n";
}
}
}
}
|