AbstractResponseTest::testDefaultMethods()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 0
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