2 Any sections that implement the PHPT_Section_RunnableBefore interface are run prior
3 to running the FILE section
7 require_once dirname(__FILE__) . '/../_setup.inc';
9 class PHPT_Section_SimpleBeforeOne implements PHPT_Section_RunnableBefore {
10 public function run(PHPT_Case $case) {
11 echo __CLASS__ . " called\n";
14 public function getPriority() { }
17 class PHPT_Section_SimpleBeforeTwo implements PHPT_Section_RunnableBefore {
18 public function run(PHPT_Case $case) {
19 echo __CLASS__ . " called\n";
22 public function getPriority() { }
25 $file = new PHPT_Section_FILE("Hello World!\n");
26 $file->filename = dirname(__FILE__) . '/fake-test-case.php';
28 $case = new PHPT_Case(
29 new PHPT_SectionList(array(
30 new PHPT_Section_SimpleBeforeOne(),
31 new PHPT_Section_SimpleBeforeTwo(),
34 dirname(__FILE__) . '/fake-test-case.phpt'
37 $case->run(new PHPT_Reporter_Null());
43 PHPT_Section_SimpleBeforeOne called
44 PHPT_Section_SimpleBeforeTwo called