1 | <?php |
||
10 | final class HttpTest extends TestCase |
||
11 | { |
||
12 | /** |
||
13 | * @test |
||
14 | * @group unit |
||
15 | * @covers ::parseHeaders |
||
16 | * |
||
17 | * @return void |
||
18 | */ |
||
19 | public function parseHeadersBasicUsage() |
||
25 | |||
26 | /** |
||
27 | * @test |
||
28 | * @group unit |
||
29 | * @covers ::parseHeaders |
||
30 | * |
||
31 | * @return void |
||
32 | */ |
||
33 | public function parseHeadersMalformed() |
||
43 | |||
44 | /** |
||
45 | * Verifies parseHeaders retains the functionality of http_parse_headers() |
||
46 | * |
||
47 | * @test |
||
48 | * @group unit |
||
49 | * @covers ::parseHeaders |
||
50 | * |
||
51 | * @return void |
||
52 | */ |
||
53 | public function parseHeadersPeclHttpFunctionality() |
||
73 | |||
74 | /** |
||
75 | * Verifies Request Method and Request Url are set properly |
||
76 | * |
||
77 | * @test |
||
78 | * @group unit |
||
79 | * @covers ::parseHeaders |
||
80 | * |
||
81 | * @return void |
||
82 | */ |
||
83 | public function parseHeadersMethodAndUrlSet() |
||
99 | |||
100 | /** |
||
101 | * Verifies that the rawHeaders string cannot be whitespace. |
||
102 | * |
||
103 | * @test |
||
104 | * @group unit |
||
105 | * @covers ::parseHeaders |
||
106 | * |
||
107 | * @expectedException \InvalidArgumentException |
||
108 | * @expectedExceptionMessage $rawHeaders cannot be whitespace |
||
109 | * |
||
110 | * @return void |
||
111 | */ |
||
112 | public function parseHeadersWhitespace() |
||
116 | |||
117 | /** |
||
118 | * @test |
||
119 | * @covers ::buildQueryString |
||
120 | * |
||
121 | * @return void |
||
122 | */ |
||
123 | public function buildQueryStringBasicUse() |
||
139 | |||
140 | /** |
||
141 | * @test |
||
142 | * @covers ::buildQueryString |
||
143 | * |
||
144 | * @return void |
||
145 | */ |
||
146 | public function buildQueryStringMultiValue() |
||
152 | |||
153 | /** |
||
154 | * @test |
||
155 | * @covers ::buildQueryString |
||
156 | * |
||
157 | * @return void |
||
158 | */ |
||
159 | public function buildQueryStringComplexValues() |
||
166 | |||
167 | /** |
||
168 | * Verifies Multi Parameter Method can handle a normal url |
||
169 | * |
||
170 | * @test |
||
171 | * @group unit |
||
172 | * @covers ::getQueryParams |
||
173 | * |
||
174 | * @return void |
||
175 | */ |
||
176 | public function getQueryParamsNormal() |
||
188 | |||
189 | /** |
||
190 | * Verifies Multi Parameter Method can handle a url with an empty parameter |
||
191 | * |
||
192 | * @test |
||
193 | * @group unit |
||
194 | * @covers ::getQueryParams |
||
195 | * |
||
196 | * @return void |
||
197 | */ |
||
198 | public function getQueryParamsEmptyParameter() |
||
209 | |||
210 | /** |
||
211 | * Verifies multi parameter method with a garbage query string |
||
212 | * |
||
213 | * @test |
||
214 | * @group unit |
||
215 | * @covers ::getQueryParams |
||
216 | * |
||
217 | * @return void |
||
218 | */ |
||
219 | public function getQueryParamsGarbage() |
||
223 | |||
224 | /** |
||
225 | * @test |
||
226 | * @covers ::getQueryParams |
||
227 | * |
||
228 | * @return void |
||
229 | */ |
||
230 | public function getQueryParamsWithCollapsed() |
||
235 | |||
236 | /** |
||
237 | * @test |
||
238 | * @covers ::getQueryParams |
||
239 | * @expectedException \Exception |
||
240 | * @expectedExceptionMessage Parameter 'stuff' had more than one value but in $collapsedParams |
||
241 | * |
||
242 | * @return void |
||
243 | */ |
||
244 | public function getQueryParamsCollapsedMoreThanOneValue() |
||
248 | |||
249 | /** |
||
250 | * @test |
||
251 | * @covers ::getQueryParamsCollapsed |
||
252 | * |
||
253 | * @return void |
||
254 | */ |
||
255 | public function getQueryParamsCollapsed() |
||
261 | |||
262 | /** |
||
263 | * @test |
||
264 | * @covers ::getQueryParamsCollapsed |
||
265 | * @expectedException \Exception |
||
266 | * @expectedExceptionMessage Parameter 'boo' is not expected to be an array, but array given |
||
267 | * |
||
268 | * @return void |
||
269 | */ |
||
270 | public function getQueryParamsCollapsedUnexpectedArray() |
||
275 | |||
276 | /** |
||
277 | * Verifies multi parameter method with a garbage query string |
||
278 | * |
||
279 | * @test |
||
280 | * @covers ::getQueryParamsCollapsed |
||
281 | * |
||
282 | * @return void |
||
283 | */ |
||
284 | public function getQueryParamsCollapsedGarbage() |
||
288 | |||
289 | /** |
||
290 | * Verifies Multi Parameter Method can handle a url with an empty parameter |
||
291 | * |
||
292 | * @test |
||
293 | * @covers ::getQueryParamsCollapsed |
||
294 | * |
||
295 | * @return void |
||
296 | */ |
||
297 | public function getQueryParamsCollapsedEmptyParameter() |
||
303 | } |
||
304 |