Completed
Push — master ( bd558f...6391f6 )
by WEBEWEB
02:19
created

CURLResponseTest::testConstruct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 11
rs 9.9
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
/**
4
 * This file is part of the curl-library package.
5
 *
6
 * (c) 2017 WEBEWEB
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace WBW\Library\CURL\Response;
13
14
use PHPUnit_Framework_TestCase;
15
16
/**
17
 * cURL response test.
18
 *
19
 * @author webeweb <https://github.com/webeweb/>
20
 * @package WBW\Library\CURL\Tests\Response
21
 * @final
22
 */
23
final class CURLResponseTest extends PHPUnit_Framework_TestCase {
24
25
    /**
26
     * Tests the __constructor() method.
27
     *
28
     * @return void
29
     */
30
    public function testConstruct() {
31
32
        $obj = new CURLResponse();
33
34
        $this->assertNull($obj->getRequestBody());
35
        $this->assertEquals([], $obj->getRequestHeader());
36
        $this->assertNull($obj->getRequestURL());
37
        $this->assertNull($obj->getResponseBody());
38
        $this->assertEquals([], $obj->getResponseHeader());
39
        $this->assertEquals([], $obj->getResponseInfo());
40
    }
41
42
    /**
43
     * Tests the setRequestBody() method.
44
     *
45
     * @return void
46
     */
47
    public function testSetRequestBody() {
48
49
        $obj = new CURLResponse();
50
51
        $obj->setRequestBody("requestBody");
52
        $this->assertEquals("requestBody", $obj->getRequestBody());
53
    }
54
55
    /**
56
     * Tests the setRequestHeader() method.
57
     *
58
     * @return void
59
     */
60
    public function testSetRequestHeader() {
61
62
        $obj = new CURLResponse();
63
64
        $obj->setRequestHeader(["requestHeader" => "requestHeader"]);
65
        $this->assertEquals(["requestHeader" => "requestHeader"], $obj->getRequestHeader());
66
    }
67
68
    /**
69
     * Tests the setRequestURL() method.
70
     *
71
     * @return void
72
     */
73
    public function testSetRequestURL() {
74
75
        $obj = new CURLResponse();
76
77
        $obj->setRequestURL("requestURL");
78
        $this->assertEquals("requestURL", $obj->getRequestURL());
79
    }
80
81
    /**
82
     * Tests the setResponseBody() method.
83
     *
84
     * @return void
85
     */
86
    public function testSetResponseBody() {
87
88
        $obj = new CURLResponse();
89
90
        $obj->setResponseBody("responseBody");
91
        $this->assertEquals("responseBody", $obj->getResponseBody());
92
    }
93
94
    /**
95
     * Tests the setResponseHeader() method.
96
     *
97
     * @return void
98
     */
99
    public function testSetResponseHeader() {
100
101
        $obj = new CURLResponse();
102
103
        $obj->setResponseHeader(["responseHeader" => "responseHeader"]);
104
        $this->assertEquals(["responseHeader" => "responseHeader"], $obj->getResponseHeader());
105
    }
106
107
    /**
108
     * Tests the setResponseInfo() method.
109
     *
110
     * @return void
111
     */
112
    public function testSetResponseInfo() {
113
114
        $obj = new CURLResponse();
115
116
        $obj->setResponseInfo(["responseInfo" => "responseInfo"]);
117
        $this->assertEquals(["responseInfo" => "responseInfo"], $obj->getResponseInfo());
118
    }
119
120
}
121