Completed
Pull Request — develop (#2)
by Adam
02:07
created

AbstractRequestTest_MockAbstractRequest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getData() 0 1 1
A sendData() 0 4 1
1
<?php
2
3
namespace IBM\Watson\ToneAnalyzer\Message;
4
5
use GuzzleHttp\Client;
6
use IBM\Watson\Common\Message\ResponseInterface;
7
use Mockery as m;
8
use Symfony\Component\HttpFoundation\Request;
9
10
class AbstractRequestTest extends \PHPUnit_Framework_TestCase
11
{
12
    protected $request;
13
14
    public function setUp()
15
    {
16
        $this->request = m::mock('\IBM\Watson\ToneAnalyzer\Message\AbstractRequest')->makePartial();
17
        $this->request->initialize();
18
    }
19
20
    public function testVersion()
21
    {
22
        $this->assertSame('2016-05-19', $this->request->getVersion());
23
        $this->assertSame($this->request, $this->request->setVersion('2017-01-01'));
24
        $this->assertSame('2017-01-01', $this->request->getVersion());
25
    }
26
27
    public function testText()
28
    {
29
        $this->assertSame($this->request, $this->request->setText('Some test text'));
30
        $this->assertSame('Some test text', $this->request->getText());
31
    }
32
}
33
34
class AbstractRequestTest_MockAbstractRequest extends AbstractRequest
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class should be in its own file to aid autoloaders.

Having each class in a dedicated file usually plays nice with PSR autoloaders and is therefore a well established practice. If you use other autoloaders, you might not want to follow this rule.

Loading history...
35
{
36
    public function getData() {}
37
38
    public function sendData($data)
39
    {
40
41
    }
42
}
43