3 * TextDetailReporter.php
11 class TextDetailReporter extends SimpleReporter {
14 * Does nothing yet. The first output will
15 * be sent on the first test start.
18 function TextDetailReporter()
20 $this->SimpleReporter();
24 * Paints the title only.
25 * @param string $test_name Name class of test.
28 function paintHeader($test_name) {
29 if (!SimpleReporter::inCli()) {
30 header('Content-type: text/plain');
32 print "{$test_name}\n";
37 * Paints the end of the test with a summary of
38 * the passes and failures.
39 * @param string $test_name Name class of test.
42 function paintFooter($test_name) {
43 if ($this->getFailCount() + $this->getExceptionCount() == 0) {
46 print "\nFAILURES!!!\n";
48 print "Test cases run: " . $this->getTestCaseProgress() .
49 "/" . $this->getTestCaseCount() .
50 ", Passes: " . $this->getPassCount() .
51 ", Failures: " . $this->getFailCount() .
52 ", Exceptions: " . $this->getExceptionCount() . "\n";
56 * Paints the test failure as a stack trace.
57 * @param string $message Failure message displayed in
58 * the context of the other tests.
61 function paintFail($message) {
62 parent::paintFail($message);
63 print "\n\t" . $this->getFailCount() . ") $message\n";
64 $breadcrumb = $this->getTestList();
65 array_shift($breadcrumb);
66 print "\tin " . implode("\n\tin ", array_reverse($breadcrumb));
71 * Paints a PHP error or exception.
72 * @param string $message Message is ignored.
76 function paintError($message) {
77 parent::paintError($message);
78 print "Exception " . $this->getExceptionCount() . "!\n$message\n";
82 * Paints formatted text such as dumped variables.
83 * @param string $message Text to show.
86 function paintFormattedMessage($message) {
91 function paintMethodStart($test_name)
93 //print "Start {$test_name} Test\n";
94 print " |--- {$test_name}";
95 $this->before_fails = $this->_fails;
98 var $before_fails = 0;
100 function paintMethodEnd($test_name)
102 //print "End {$test_name} Test\n";
103 if ($this->before_fails != $this->_fails) {
111 function paintCaseStart($test_name)
113 print "\n {$test_name}\n";
114 return parent::paintCaseStart($test_name);