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

CURLRequestCallExceptionTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 3
dl 0
loc 22
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A testConstruct() 0 13 1
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\Tests\Exception;
13
14
use PHPUnit_Framework_TestCase;
15
use WBW\Library\CURL\Exception\CURLRequestCallException;
16
use WBW\Library\CURL\Response\CURLResponse;
17
18
/**
19
 * cURL request call exception test.
20
 *
21
 * @author webeweb <https://github.com/webeweb/>
22
 * @package WBW\Library\CURL\Tests\Exception
23
 * @final
24
 */
25
final class CURLRequestCallExceptionTest extends PHPUnit_Framework_TestCase {
26
27
    /**
28
     * Tests the __constructor() method.
29
     *
30
     * @return void
31
     */
32
    public function testConstruct() {
33
34
        $obj = new CURLRequestCallException("exception", 404, new CURLResponse());
35
36
        $this->assertEquals(404, $obj->getCode());
37
        $this->assertEquals("exception", $obj->getMessage());
38
        $this->assertNull($obj->getResponse()->getRequestBody());
39
        $this->assertEquals([], $obj->getResponse()->getRequestHeader());
40
        $this->assertNull($obj->getResponse()->getRequestURL());
41
        $this->assertNull($obj->getResponse()->getResponseBody());
42
        $this->assertEquals([], $obj->getResponse()->getResponseHeader());
43
        $this->assertEquals([], $obj->getResponse()->getResponseInfo());
44
    }
45
46
}
47