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

AbstractRequestTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
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 27
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 5 1
A testGetResponseBeforeSend() 0 4 1
A testGetParameters() 0 4 1
1
<?php
2
3
namespace Bobbyshaw\WatsonVisualRecognition\Tests\Message;
4
5
use Bobbyshaw\WatsonVisualRecognition\Message\AbstractRequest;
6
use Bobbyshaw\WatsonVisualRecognition\Tests\Base;
7
use GuzzleHttp\Client;
8
9
/**
10
 * Class AbstractRequestTest
11
 * @package Bobbyshaw\WatsonVisualRecognition\Tests\Message
12
 */
13
class AbstractRequestTest extends Base
14
{
15
    /**
16
     * @var AbstractRequest
17
     */
18
    private $request;
19
    private $config = ['username' => 'username'];
20
21
    public function setUp()
22
    {
23
        $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...
24
        $this->request->initialize($this->config);
25
    }
26
27
    /**
28
     * @expectedException \RuntimeException
29
     */
30
    public function testGetResponseBeforeSend()
31
    {
32
        $this->request->getResponse();
33
    }
34
35
    public function testGetParameters()
36
    {
37
        $this->assertEquals($this->config, $this->request->getParameters());
38
    }
39
}
40