ResponseTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 15
dl 0
loc 24
rs 10
c 0
b 0
f 0
ccs 11
cts 11
cp 1
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A testFromHttpResponse() 0 22 1
1
<?php
2
3
namespace Promopult\Integra\Test;
4
5
class ResponseTest extends \PHPUnit\Framework\TestCase
6
{
7 1
    public function testFromHttpResponse()
8
    {
9 1
        $httpResp = new \GuzzleHttp\Psr7\Response(
10 1
            200,
11 1
            [],
12 1
            json_encode([
13 1
                'version' => '1',
14
                'status'  => [
15
                    'code'    => 1,
16
                    'message' => 'message'
17
                ],
18
                'error'   => true,
19
                'notices' => ['notice'],
20
            ])
21
        );
22
23 1
        $apiResp = \Promopult\Integra\Response::fromHttpResponse($httpResp);
24
25 1
        $this->assertEquals('1', $apiResp->getVersion());
26 1
        $this->assertEquals(1, $apiResp->getStatusCode());
27 1
        $this->assertEquals('message', $apiResp->getStatusMessage());
28 1
        $this->assertEquals(true, $apiResp->hasError());
29 1
    }
30
}
31