Completed
Push — develop ( 4ff741...64bd10 )
by Tom
14:53
created

AbstractResponseTest   A

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()]);
1 ignored issue
show
Documentation Bug introduced by
It seems like $this->getMockForAbstrac... \GuzzleHttp\Client())) of type object<PHPUnit_Framework_MockObject_MockObject> is incompatible with the declared type object<Bobbyshaw\WatsonV...essage\AbstractRequest> of property $request.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
31
        $this->response = $this->getMockForAbstractClass(AbstractResponse::class, [$this->request, $this->data]);
1 ignored issue
show
Documentation Bug introduced by
It seems like $this->getMockForAbstrac...>request, $this->data)) of type object<PHPUnit_Framework_MockObject_MockObject> is incompatible with the declared type object<Bobbyshaw\WatsonV...ssage\AbstractResponse> of property $response.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
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