AbstractResponseTest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 4 1
A testConstruct() 0 9 1
A testDefaultMethods() 0 6 1
1
<?php
2
3
4
namespace IBM\Watson\Common\Message;
5
6
use IBM\Watson\Tests\TestCase;
7
use Mockery as m;
8
9
class AbstractResponseTest extends TestCase
10
{
11
    private $response;
12
13
    public function setUp()
14
    {
15
        $this->response = m::mock('\IBM\Watson\Common\Message\AbstractResponse')->makePartial();
16
    }
17
18
    public function testConstruct()
19
    {
20
        $data = ['foo' => 'bar'];
21
        $request = $this->getMockRequest();
22
        $this->response = m::mock('\IBM\Watson\Common\Message\AbstractResponse', [$request, $data])->makePartial();
23
24
        $this->assertSame($request, $this->response->getRequest());
25
        $this->assertSame($data, $this->response->getData());
26
    }
27
28
    public function testDefaultMethods()
29
    {
30
        $this->assertNull($this->response->getMessage());
31
        $this->assertNull($this->response->getData());
32
        $this->assertNull($this->response->getCode());
33
    }
34
}
35