1 | <?php |
||
7 | class ResponseTest extends \PHPUnit_Framework_TestCase |
||
8 | { |
||
9 | private $responseTestHeaders = "Server: nginx |
||
10 | Date: Fri, 09 Apr 2021 09:13:04 GMT |
||
11 | Content-Type: application/json"; |
||
12 | private $responseTestData = '{ "key1": "value1", "key2": "value2" }'; |
||
13 | |||
14 | /** |
||
15 | * Test the success response HTTP codes. |
||
16 | * |
||
17 | * @param string $httpCode The HTTP code we want to test |
||
18 | * @param string $expectedResult What we expect the result to be |
||
19 | * |
||
20 | * @dataProvider providerTestSuccessResponseHTTPCodes |
||
21 | */ |
||
22 | public function testSuccessResponseHTTPCodes($httpCode, $expectedResult) |
||
30 | |||
31 | public function providerTestSuccessResponseHTTPCodes() |
||
41 | |||
42 | /** |
||
43 | * Test the return of HTTP status codes. |
||
44 | * |
||
45 | * @param string $httpCode The HTTP code we want to test |
||
46 | * @param string $expectedCode What we expect the result to be |
||
47 | * |
||
48 | * @dataProvider providerTestReturnOfHTTPStatusCodes |
||
49 | */ |
||
50 | public function testReturnOfHTTPStatusCodes($httpCode, $expectedCode) |
||
58 | |||
59 | public function providerTestReturnOfHTTPStatusCodes() |
||
67 | |||
68 | public function testReturnOfResponseDataAsArray() |
||
76 | |||
77 | public function testReturnOfEmptyResponseDataAsArray() |
||
85 | |||
86 | public function testReturnOfResponseDataAsObject() |
||
94 | |||
95 | public function testReturnOfEmptyResponseDataAsObject() |
||
103 | |||
104 | public function testReturnOfResponseDataAsRaw() |
||
114 | |||
115 | public function testReturnOfResponseHeadersArrayKeyValuePairArray() |
||
124 | |||
125 | public function testReturnOfResponseHeaderServer() |
||
132 | } |
||
133 |