1 | <?php |
||
10 | class ResponseTest extends PHPUnit_Framework_TestCase |
||
11 | { |
||
12 | |||
13 | /** |
||
14 | * @covers Fracture\Http\Response::getBody |
||
15 | * @covers Fracture\Http\Response::getStatusCode |
||
16 | * @covers Fracture\Http\Response::getHeaders |
||
17 | */ |
||
18 | public function testDefaultValues() |
||
25 | |||
26 | |||
27 | /** |
||
28 | * @covers Fracture\Http\Response::getBody |
||
29 | * @covers Fracture\Http\Response::setStatusCode |
||
30 | * @covers Fracture\Http\Response::getStatusCode |
||
31 | */ |
||
32 | public function testProperStatusCode() |
||
38 | |||
39 | |||
40 | /** |
||
41 | * @expectedException InvalidArgumentException |
||
42 | * |
||
43 | * @covers Fracture\Http\Response::getBody |
||
44 | * @covers Fracture\Http\Response::setStatusCode |
||
45 | */ |
||
46 | public function testBadStatusCode() |
||
51 | |||
52 | |||
53 | /** |
||
54 | * @covers Fracture\Http\Response::setBody |
||
55 | * @covers Fracture\Http\Response::appendBody |
||
56 | * @covers Fracture\Http\Response::prependBody |
||
57 | * @covers Fracture\Http\Response::getBody |
||
58 | */ |
||
59 | public function testSimpleBodyOperations() |
||
75 | |||
76 | |||
77 | /** |
||
78 | * @covers Fracture\Http\Response::addHeader |
||
79 | * @covers Fracture\Http\Response::getHeaders |
||
80 | * |
||
81 | * @covers Fracture\Http\Response::populateHeaderList |
||
82 | */ |
||
83 | public function testSimpleHeader() |
||
105 | |||
106 | |||
107 | /** |
||
108 | * @covers Fracture\Http\Response::addHeader |
||
109 | * @covers Fracture\Http\Response::getHeaders |
||
110 | * |
||
111 | * @covers Fracture\Http\Response::populateHeaderList |
||
112 | */ |
||
113 | public function testReplacingHeaderInstance() |
||
146 | |||
147 | |||
148 | /** |
||
149 | * @covers Fracture\Http\Response::addHeader |
||
150 | * @covers Fracture\Http\Response::getHeaders |
||
151 | * |
||
152 | * @covers Fracture\Http\Response::populateHeaderList |
||
153 | * @covers Fracture\Http\Response::adjustForHostname |
||
154 | */ |
||
155 | public function testSimpleLocationHeaderAddition() |
||
178 | |||
179 | |||
180 | /** |
||
181 | * @covers Fracture\Http\Response::addHeader |
||
182 | * @covers Fracture\Http\Response::getHeaders |
||
183 | * @covers Fracture\Http\Response::setHostname |
||
184 | * |
||
185 | * @covers Fracture\Http\Response::populateHeaderList |
||
186 | * @covers Fracture\Http\Response::adjustForHostname |
||
187 | * |
||
188 | * @dataProvider provideLocationHeaderAdditionWithHostnameSet |
||
189 | */ |
||
190 | public function testLocationHeaderAdditionWithHostnameSet($host, $path, $expected) |
||
213 | |||
214 | |||
215 | public function provideLocationHeaderAdditionWithHostnameSet() |
||
235 | |||
236 | /** |
||
237 | * @covers Fracture\Http\Response::removeCookie |
||
238 | * @covers Fracture\Http\Response::getHeaders |
||
239 | */ |
||
240 | public function testSimpleRemoveCookie() |
||
252 | |||
253 | |||
254 | /** |
||
255 | * @covers Fracture\Http\Response::removeCookie |
||
256 | * @covers Fracture\Http\Response::getHeaders |
||
257 | */ |
||
258 | public function testMoreComplicatedSimpleRemoveCookie() |
||
273 | |||
274 | |||
275 | /** |
||
276 | * @covers Fracture\Http\Response::addCookie |
||
277 | * @covers Fracture\Http\Response::getHeaders |
||
278 | */ |
||
279 | public function testAddCookie() |
||
291 | |||
292 | |||
293 | |||
294 | } |
||
295 |