AbstractResponseTest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 5 1
A testGetRequest() 0 4 1
A testGetData() 0 4 1
1
<?php
2
3
namespace Bobbyshaw\WatsonVisualRecognition\Tests\Message;
4
5
use Bobbyshaw\WatsonVisualRecognition\Message\AbstractRequest;
6
use Bobbyshaw\WatsonVisualRecognition\Message\AbstractResponse;
7
use Bobbyshaw\WatsonVisualRecognition\Tests\Base;
8
use GuzzleHttp\Client;
9
10
/**
11
 * Class AbstractResponseTest
12
 * @package Bobbyshaw\WatsonVisualRecognition\Tests\Message
13
 */
14
class AbstractResponseTest extends Base
15
{
16
    /**
17
     * @var AbstractRequest
18
     */
19
    protected $request;
20
21
    /**
22
     * @var AbstractResponse
23
     */
24
    protected $response;
25
26
    protected $data = 'test';
27
28
    public function setUp()
29
    {
30
        $this->request = $this->getMockForAbstractClass(AbstractRequest::class, [new Client()]);
31
        $this->response = $this->getMockForAbstractClass(AbstractResponse::class, [$this->request, $this->data]);
32
    }
33
    
34
    public function testGetRequest()
35
    {
36
        $this->assertEquals($this->request, $this->response->getRequest());
37
    }
38
39
    public function testGetData()
40
    {
41
        $this->assertEquals($this->data, $this->response->getData());
42
    }
43
}
44