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 isFocused() |
||
44 | |||
45 | /** |
||
46 | * Set the focused status of the test and its children according to the |
||
47 | * supplied focus pattern and/or skip pattern |
||
48 | * |
||
49 | * @param string|null $focusPattern |
||
50 | * @param string|null $skipPattern |
||
51 | */ |
||
52 | public function applyFocusPatterns($focusPattern, $skipPattern = null) |
||
60 | |||
61 | /** |
||
62 | * Add a test to the suite |
||
63 | * |
||
64 | * @param Test $test |
||
65 | */ |
||
66 | public function addTest(TestInterface $test) |
||
71 | |||
72 | /** |
||
73 | * Return collection of tests |
||
74 | * |
||
75 | * @return array |
||
76 | */ |
||
77 | public function getTests() |
||
81 | |||
82 | /** |
||
83 | * Set suite tests |
||
84 | * |
||
85 | * @param array $tests |
||
86 | */ |
||
87 | public function setTests(array $tests) |
||
91 | |||
92 | /** |
||
93 | * Execute the Suite definition. |
||
94 | * |
||
95 | * @return void |
||
96 | */ |
||
97 | public function define() |
||
102 | |||
103 | /** |
||
104 | * Run all the specs belonging to the suite |
||
105 | * |
||
106 | * @param TestResult $result |
||
107 | */ |
||
108 | public function run(TestResult $result) |
||
123 | |||
124 | /** |
||
125 | * Put the Suite in a halted state. A halted Suite will not run or will |
||
126 | * stop running if currently running. |
||
127 | * |
||
128 | * @return void |
||
129 | */ |
||
130 | public function halt() |
||
134 | |||
135 | /** |
||
136 | * Run a test and track its results. |
||
137 | * |
||
138 | * @param TestInterface $test |
||
139 | * @param TestResult $result |
||
140 | */ |
||
141 | protected function runTest(TestInterface $test, TestResult $result) |
||
150 | |||
151 | /** |
||
152 | * Get the subset of the defined tests that should actually be run. |
||
153 | * |
||
154 | * @return array |
||
155 | */ |
||
156 | protected function getTestsToRun() |
||
164 | } |
||
165 |