1 | <?php namespace Limoncello\Testing; |
||
27 | trait TestCaseTrait |
||
28 | { |
||
29 | /** |
||
30 | * @var array |
||
31 | */ |
||
32 | private $eventHandlers = []; |
||
33 | |||
34 | /** |
||
35 | * @param array|null $server |
||
36 | * @param array|null $queryParams |
||
37 | * @param array|object|null $parsedBody |
||
|
|||
38 | * @param array|null $cookies |
||
39 | * @param array|null $files |
||
40 | * @param string|resource|StreamInterface $messageBody |
||
41 | * @param string $protocolVersion |
||
42 | * |
||
43 | * @return Sapi |
||
44 | */ |
||
45 | abstract protected function createSapi( |
||
54 | |||
55 | /** |
||
56 | * @param Sapi $sapi |
||
57 | * |
||
58 | * @return ApplicationInterface |
||
59 | */ |
||
60 | abstract protected function createApplication(Sapi $sapi): ApplicationInterface; |
||
61 | |||
62 | /** @noinspection PhpTooManyParametersInspection |
||
63 | * @param string $method |
||
64 | * @param string $uri |
||
65 | * @param array $queryParams |
||
66 | * @param array $parsedBody |
||
67 | * @param array $headers |
||
68 | * @param array $cookies |
||
69 | * @param array $files |
||
70 | * @param array $server |
||
71 | * @param string|resource|StreamInterface $content |
||
72 | * @param string $host |
||
73 | * @param string $protocolVersion |
||
74 | * |
||
75 | * @return ResponseInterface |
||
76 | * |
||
77 | * @SuppressWarnings(PHPMD.ExcessiveParameterList) |
||
78 | */ |
||
79 | 8 | protected function call( |
|
117 | |||
118 | /** |
||
119 | * @return void |
||
120 | */ |
||
121 | 1 | protected function resetEventHandlers() |
|
125 | |||
126 | /** |
||
127 | * @param Closure $handler |
||
128 | * |
||
129 | * @return void |
||
130 | */ |
||
131 | 1 | protected function addOnHandleRequestEvent(Closure $handler) |
|
135 | |||
136 | /** |
||
137 | * @param Closure $handler |
||
138 | * |
||
139 | * @return void |
||
140 | */ |
||
141 | 1 | protected function addOnHandleResponseEvent(Closure $handler) |
|
145 | |||
146 | /** |
||
147 | * @param Closure $handler |
||
148 | * |
||
149 | * @return void |
||
150 | */ |
||
151 | 1 | protected function addOnContainerCreatedEvent(Closure $handler) |
|
155 | |||
156 | /** |
||
157 | * @param Closure $handler |
||
158 | * |
||
159 | * @return void |
||
160 | */ |
||
161 | 1 | protected function addOnContainerConfiguredEvent(Closure $handler) |
|
165 | |||
166 | /** |
||
167 | * @return array |
||
168 | */ |
||
169 | 1 | protected function getHandleRequestEvents(): array |
|
173 | |||
174 | /** |
||
175 | * @return array |
||
176 | */ |
||
177 | 1 | protected function getHandleResponseEvents(): array |
|
181 | |||
182 | /** |
||
183 | * @return array |
||
184 | */ |
||
185 | 1 | protected function getContainerCreatedEvents(): array |
|
189 | |||
190 | /** |
||
191 | * @return array |
||
192 | */ |
||
193 | 1 | protected function getContainerConfiguredEvents(): array |
|
197 | } |
||
198 |