Completed
Pull Request — develop (#1)
by Adam
02:12
created

AbstractResponseTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 4 1
A testConstruct() 0 9 1
1
<?php
2
3
namespace IBM\Watson\Common\Tests\Message;
4
5
use Mockery as m;
6
7
class AbstractResponseTest extends \PHPUnit_Framework_TestCase
8
{
9
    protected $response;
10
11
    public function setUp()
12
    {
13
        $this->response = m::mock('\IBM\Watson\Common\Message\AbstractResponse')->makePartial();
14
    }
15
16
    public function testConstruct()
17
    {
18
        $data = ['username' => 'adam', 'password' => 'adam'];
19
        $request = m::mock('\IBM\Watson\Common\Message\RequestInterface');
20
        $this->response = m::mock('\IBM\Watson\Common\Message\AbstractResponse', [$request, $data])->makePartial();
21
22
        $this->assertSame($request, $this->response->getRequest());
23
        $this->assertSame($data, $this->response->getData());
24
    }
25
}
26