1 | <?php |
||
9 | class Suite extends AbstractTest |
||
10 | { |
||
11 | /** |
||
12 | * Tests belonging to this suite |
||
13 | * |
||
14 | * @var array |
||
15 | */ |
||
16 | protected $tests = []; |
||
17 | |||
18 | /** |
||
19 | * Has the suite been halted |
||
20 | * |
||
21 | * @var bool |
||
22 | */ |
||
23 | protected $halted = false; |
||
24 | |||
25 | /** |
||
26 | * Add a test to the suite |
||
27 | * |
||
28 | * @param Test $test |
||
29 | */ |
||
30 | public function addTest(TestInterface $test) |
||
35 | |||
36 | /** |
||
37 | * Return collection of tests |
||
38 | * |
||
39 | * @return array |
||
40 | */ |
||
41 | public function getTests() |
||
45 | |||
46 | /** |
||
47 | * Set suite tests |
||
48 | * |
||
49 | * @param array $tests |
||
50 | */ |
||
51 | public function setTests(array $tests) |
||
55 | |||
56 | /** |
||
57 | * Execute the Suite definition. |
||
58 | * |
||
59 | * @return void |
||
60 | */ |
||
61 | public function define() |
||
66 | |||
67 | /** |
||
68 | * Run all the specs belonging to the suite |
||
69 | * |
||
70 | * @param TestResult $result |
||
71 | */ |
||
72 | public function run(TestResult $result) |
||
86 | |||
87 | /** |
||
88 | * Put the Suite in a halted state. A halted Suite will not run or will |
||
89 | * stop running if currently running. |
||
90 | * |
||
91 | * @return void |
||
92 | */ |
||
93 | public function halt() |
||
97 | |||
98 | /** |
||
99 | * Run a test and track its results. |
||
100 | * |
||
101 | * @param TestInterface $test |
||
102 | * @param TestResult $result |
||
103 | */ |
||
104 | protected function runTest(TestInterface $test, TestResult $result) |
||
113 | |||
114 | private function focusedTests() |
||
132 | } |
||
133 |