1 | <?php |
||
19 | class Module extends Framework |
||
20 | { |
||
21 | /** |
||
22 | * Required configuration fields |
||
23 | * @var array |
||
24 | */ |
||
25 | protected $requiredFields = ['container']; |
||
26 | |||
27 | /** |
||
28 | * @var ContainerInterface |
||
29 | */ |
||
30 | public $container; |
||
31 | |||
32 | /** |
||
33 | * @var ServerRequestInterface |
||
34 | */ |
||
35 | public $baseRequest; |
||
36 | |||
37 | /** |
||
38 | * @var ResponseInterface |
||
39 | */ |
||
40 | public $baseResponse; |
||
41 | |||
42 | |||
43 | /** |
||
44 | * Load the container by including the file. |
||
45 | * @codeCoverageIgnore |
||
46 | * |
||
47 | * @param string $file |
||
48 | * @return ContainerInterface |
||
49 | */ |
||
50 | protected function loadContainer($file) |
||
54 | |||
55 | /** |
||
56 | * Get the container. |
||
57 | * |
||
58 | * @return ContainerInterface |
||
59 | */ |
||
60 | 7 | protected function initContainer() |
|
70 | |||
71 | /** |
||
72 | * Check if the response writes to the output buffer |
||
73 | * |
||
74 | * @return boolean |
||
75 | */ |
||
76 | 7 | protected function usesOutputBuffer() |
|
80 | |||
81 | /** |
||
82 | * Enable output buffering |
||
83 | * |
||
84 | * @throws \RuntimeException |
||
85 | */ |
||
86 | 2 | protected function startOutputBuffering() |
|
96 | |||
97 | /** |
||
98 | * Disable output buffering |
||
99 | */ |
||
100 | 1 | protected function stopOutputBuffering() |
|
104 | |||
105 | /** |
||
106 | * Initialize the module |
||
107 | */ |
||
108 | 7 | public function init() |
|
120 | |||
121 | /** |
||
122 | * Call before suite |
||
123 | * |
||
124 | * @param array $settings |
||
125 | */ |
||
126 | 4 | public function _beforeSuite($settings = []) |
|
134 | |||
135 | /** |
||
136 | * Call after suite |
||
137 | */ |
||
138 | 3 | public function _afterSuite() |
|
146 | |||
147 | /** |
||
148 | * Before each test |
||
149 | * |
||
150 | * @param TestInterface $test |
||
151 | */ |
||
152 | 4 | public function _before(TestInterface $test) |
|
169 | |||
170 | /** |
||
171 | * After each test |
||
172 | * |
||
173 | * @param TestInterface $test |
||
174 | */ |
||
175 | 3 | public function _after(TestInterface $test) |
|
195 | |||
196 | /** |
||
197 | * Called when test fails |
||
198 | * |
||
199 | * @param TestInterface $test |
||
200 | * @param mixed $fail |
||
201 | */ |
||
202 | 1 | public function _failed(TestInterface $test, $fail) |
|
215 | |||
216 | |||
217 | /** |
||
218 | * Wrapper around `ob_start()` |
||
219 | * @codeCoverageIgnore |
||
220 | */ |
||
221 | protected function obStart() |
||
225 | |||
226 | /** |
||
227 | * Wrapper around `ob_get_level()` |
||
228 | * @codeCoverageIgnore |
||
229 | * |
||
230 | * @return int |
||
231 | */ |
||
232 | protected function obGetLevel() |
||
236 | |||
237 | /** |
||
238 | * Wrapper around `ob_clean()` |
||
239 | * @codeCoverageIgnore |
||
240 | */ |
||
241 | protected function obClean() |
||
245 | |||
246 | /** |
||
247 | * Wrapper around `session_status()` |
||
248 | * @codeCoverageIgnore |
||
249 | * |
||
250 | * @return int |
||
251 | */ |
||
252 | protected function sessionStatus() |
||
256 | |||
257 | /** |
||
258 | * Wrapper around `session_unset()` and `session_destroy()` |
||
259 | * @codeCoverageIgnore |
||
260 | */ |
||
261 | protected function sessionDestroy() |
||
266 | } |
||
267 |