Completed
Push — develop ( 86f0dd...f71342 )
by Adam
12s
created

AbstractRequestTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 5 1
A testVersion() 0 6 1
A testText() 0 5 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
    }
39
40
    public function sendData($data)
41
    {
42
    }
43
}
44