4 * Proxies results from PHPT_Reporter to SimpleTest's reporter
6 class PHPT_Reporter_SimpleTest
implements PHPT_Reporter
9 /** SimpleTest reporter to proxy results to */
12 /** @param SimpleTest reporter */
13 public function __construct($reporter) {
14 $this->reporter
= $reporter;
17 // TODO: Figure out what the proper calls should be, since we've given
18 // each Suite its own UnitTestCase controller
21 * Called when the Reporter is started from a PHPT_Suite
22 * @todo Figure out if Suites can be named
24 public function onSuiteStart(PHPT_Suite
$suite) {
25 //$this->reporter->paintGroupStart('PHPT Suite', $suite->count());
29 * Called when the Reporter is finished in a PHPT_Suite
31 public function onSuiteEnd(PHPT_Suite
$suite) {
32 //$this->reporter->paintGroupEnd('PHPT Suite');
36 * Called when a Case is started
38 public function onCaseStart(PHPT_Case
$case) {
39 //$this->reporter->paintCaseStart($case->name);
43 * Called when a Case ends
45 public function onCaseEnd(PHPT_Case
$case) {
46 //$this->reporter->paintCaseEnd($case->name);
50 * Called when a Case runs without Exception
52 public function onCasePass(PHPT_Case
$case) {
53 $this->reporter
->paintPass("{$case->name} in {$case->filename}");
57 * Called when a PHPT_Case_VetoException is thrown during a Case's run()
59 public function onCaseSkip(PHPT_Case
$case, PHPT_Case_VetoException
$veto) {
60 $this->reporter
->paintSkip($veto->getMessage() . ' [' . $case->filename
.']');
64 * Called when any Exception other than a PHPT_Case_VetoException is encountered
65 * during a Case's run()
67 public function onCaseFail(PHPT_Case
$case, PHPT_Case_FailureException
$failure) {
68 $this->reporter
->paintFail($failure->getReason());
71 public function onParserError(Exception
$exception) {
72 $this->reporter
->paintException($exception);