1 | <?php |
||
23 | final class CURLResponseTest extends PHPUnit_Framework_TestCase { |
||
24 | |||
25 | /** |
||
26 | * Tests the __constructor() method. |
||
27 | * |
||
28 | * @return void |
||
29 | */ |
||
30 | public function testConstructor() { |
||
31 | |||
32 | $obj = new CURLResponse(); |
||
33 | |||
34 | $this->assertEquals(null, $obj->getRequestBody()); |
||
35 | $this->assertEquals([], $obj->getRequestHeader()); |
||
36 | $this->assertEquals(null, $obj->getRequestURL()); |
||
37 | $this->assertEquals(null, $obj->getResponseBody()); |
||
38 | $this->assertEquals([], $obj->getResponseHeader()); |
||
39 | $this->assertEquals([], $obj->getResponseInfo()); |
||
40 | } |
||
41 | |||
42 | /** |
||
43 | * Tests the setX() method. |
||
44 | * |
||
45 | * @return void |
||
46 | */ |
||
47 | public function testSetX() { |
||
48 | |||
49 | $obj = new CURLResponse(); |
||
50 | |||
51 | $obj->setRequestBody("requestBody"); |
||
52 | $this->assertEquals("requestBody", $obj->getRequestBody()); |
||
53 | |||
54 | $obj->setRequestHeader(["requestHeader" => "requestHeader"]); |
||
55 | $this->assertEquals(["requestHeader" => "requestHeader"], $obj->getRequestHeader()); |
||
56 | |||
57 | $obj->setRequestURL("requestURL"); |
||
58 | $this->assertEquals("requestURL", $obj->getRequestURL()); |
||
59 | |||
60 | $obj->setResponseBody("responseBody"); |
||
61 | $this->assertEquals("responseBody", $obj->getResponseBody()); |
||
62 | |||
63 | $obj->setResponseHeader(["responseHeader" => "responseHeader"]); |
||
64 | $this->assertEquals(["responseHeader" => "responseHeader"], $obj->getResponseHeader()); |
||
65 | |||
66 | $obj->setResponseInfo(["responseInfo" => "responseInfo"]); |
||
67 | $this->assertEquals(["responseInfo" => "responseInfo"], $obj->getResponseInfo()); |
||
68 | } |
||
69 | |||
70 | } |
||
71 |