Total Complexity | 4 |
Total Lines | 52 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
16 | class HttpTest extends TestCase |
||
17 | { |
||
18 | /** |
||
19 | * Tests if we can write a HTTP status |
||
20 | * |
||
21 | * @return null |
||
22 | */ |
||
23 | public function testWriteStatus() |
||
24 | { |
||
25 | $http = new Http(); |
||
26 | $header = $http->writeStatus($http::HTTP_NOT_FOUND); |
||
27 | |||
28 | $this->assertEquals("HTTP/1.0 404 Not Found", $header); |
||
29 | } |
||
30 | |||
31 | /** |
||
32 | * Tests gettting status text |
||
33 | * |
||
34 | * @return null |
||
35 | */ |
||
36 | public function testGetStatusText() |
||
37 | { |
||
38 | $http = new Http(); |
||
39 | $text = $http->getStatusText($http::HTTP_NOT_FOUND); |
||
40 | |||
41 | $this->assertEquals("Not Found", $text); |
||
42 | } |
||
43 | |||
44 | /** |
||
45 | * Tests throwing exception on gettting status text |
||
46 | * |
||
47 | * @return null |
||
48 | */ |
||
49 | public function testExceptionWhenStatusTextDoesNotExists() |
||
68 | } |
||
69 | } |
||
70 | } |
||
71 |