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 | * {@inheritdoc} |
||
27 | * |
||
28 | * @return bool |
||
29 | */ |
||
30 | public function getFocused() |
||
40 | |||
41 | /** |
||
42 | * Add a test to the suite |
||
43 | * |
||
44 | * @param Test $test |
||
45 | */ |
||
46 | public function addTest(TestInterface $test) |
||
51 | |||
52 | /** |
||
53 | * Return collection of tests |
||
54 | * |
||
55 | * @return array |
||
56 | */ |
||
57 | public function getTests() |
||
61 | |||
62 | /** |
||
63 | * Set suite tests |
||
64 | * |
||
65 | * @param array $tests |
||
66 | */ |
||
67 | public function setTests(array $tests) |
||
71 | |||
72 | /** |
||
73 | * Execute the Suite definition. |
||
74 | * |
||
75 | * @return void |
||
76 | */ |
||
77 | public function define() |
||
82 | |||
83 | /** |
||
84 | * Run all the specs belonging to the suite |
||
85 | * |
||
86 | * @param TestResult $result |
||
87 | */ |
||
88 | public function run(TestResult $result) |
||
103 | |||
104 | /** |
||
105 | * Put the Suite in a halted state. A halted Suite will not run or will |
||
106 | * stop running if currently running. |
||
107 | * |
||
108 | * @return void |
||
109 | */ |
||
110 | public function halt() |
||
114 | |||
115 | /** |
||
116 | * Run a test and track its results. |
||
117 | * |
||
118 | * @param TestInterface $test |
||
119 | * @param TestResult $result |
||
120 | */ |
||
121 | protected function runTest(TestInterface $test, TestResult $result) |
||
130 | |||
131 | private function focusedTests() |
||
149 | } |
||
150 |