add result property to Case (re #36)
[phpt.git] / tests / Case / run-invokes-reporter-fail.phpt
blobc11ce81164c1bb6df5e297f6e9cdd941ff079b8e
1 --TEST--
2 If run() encounters a VetoException it will call:
4 # onCaseStart()
5 # onCaseFail()
6 # onCaseEnd()
8 on the supplied $reporter object, if any.
9 --FILE--
10 <?php
12 require_once dirname(__FILE__) . '/../_setup.inc';
13 require_once dirname(__FILE__) . '/../_simple-reporter.inc';
15 $test = new PHPT_Section_TEST('simple hello world');
16 $file = new PHPT_Section_FILE('<?php echo "Hello World!"; ?>');
17 $expect = new PHPT_Section_EXPECT('Hola World!');
18 $list = new PHPT_SectionList(array(
19     $test,
20     $file,
21     $expect,
22 ));
24 $case = new PHPT_Case($list, dirname(__FILE__) . '/fake-test-case.phpt');
25 $reporter = new PHPT_SimpleReporter();
26 $case->run($reporter);
30 ===DONE===
31 --CLEAN--
32 <?php
33 @unlink(dirname(__FILE__) . '/fake-test-case.phpt.php');
34 @unlink(dirname(__FILE__) . '/fake-test-case.phpt.exp');
35 @unlink(dirname(__FILE__) . '/fake-test-case.phpt.out');
36 @unlink(dirname(__FILE__) . '/fake-test-case.phpt.diff');
37 @unlink(dirname(__FILE__) . '/fake-test-case.phpt.log');
39 --EXPECT--
40 PHPT_SimpleReporter::onCaseStart was called
41 PHPT_SimpleReporter::onCaseFail was called
42 PHPT_SimpleReporter::onCaseEnd was called
43 ===DONE===