ResultPrinter.php
2.1 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
<?php
namespace mindplay\test\lib\ResultPrinter;
use mindplay\test\lib\xTest;
use mindplay\test\lib\xTestRunner;
abstract class ResultPrinter
{
/**
* Prints the header before the test output.
*
* @param xTestRunner $testRunner Test runner.
* @param string $pattern Test filename pattern.
* @return void
*/
public function suiteHeader(xTestRunner $testRunner, $pattern)
{
}
/**
* Prints the footer after the test output.
*
* @param xTestRunner $testRunner Test runner.
* @return void
*/
public function suiteFooter(xTestRunner $testRunner)
{
}
/**
* Creates code coverage report.
*
* @param \PHP_CodeCoverage $coverage Code coverage collector.
* @return void
*/
public function createCodeCoverageReport(\PHP_CodeCoverage $coverage = null)
{
}
/**
* Prints test header.
*
* @param xTest $test Test.
* @return void
*/
public function testHeader(xTest $test)
{
}
/**
* Prints test footer.
*
* @param xTest $test Test.
* @param integer $total Total test case count.
* @param integer $passed Passed test case count.
* @return void
*/
public function testFooter(xTest $test, $total, $passed)
{
}
/**
* Test case result.
*
* @param \ReflectionMethod $testCaseMethod Test case method.
* @param string $resultColor Result color.
* @param string $resultMessage Result message.
* @return void
*/
public function testCaseResult(\ReflectionMethod $testCaseMethod, $resultColor, $resultMessage)
{
}
/**
* Returns test case name.
*
* @param \ReflectionMethod $testCaseMethod Test case method.
* @param boolean $humanFormat Use human format.
* @return string
*/
protected function getTestCaseName(\ReflectionMethod $testCaseMethod, $humanFormat = false)
{
$ret = substr($testCaseMethod->name, 4);
return $humanFormat ? ltrim(preg_replace('/([A-Z])/', ' \1', $ret)) : $ret;
}
}