Completed
Push — master ( 06ed76...0f3f4f )
by WEBEWEB
06:00 queued 14s
created

CURLResponseTest::testSetX()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 22
Code Lines 14

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 22
rs 9.2
c 0
b 0
f 0
cc 1
eloc 14
nc 1
nop 0
1
<?php
2
3
/**
4
 * This file is part of the curl-library package.
5
 *
6
 * (c) 2017 NdC/WBW
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 NdC/WBW <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 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