Completed
Push — develop ( c8d2e9...9b1d71 )
by Adam
03:00
created

ClientTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 6 1
A testCreate() 0 5 1
A testTone() 0 6 1
1
<?php
2
3
namespace IBM\Watson\ToneAnalyzer\tests;
4
5
use Http\Client\HttpClient;
6
use IBM\Watson\Common\Hydrator\HydratorInterface;
7
use IBM\Watson\Common\RequestBuilder;
8
use IBM\Watson\ToneAnalyzer\Api\Tone;
9
use IBM\Watson\ToneAnalyzer\Client;
10
use PHPUnit\Framework\TestCase;
11
use Mockery as m;
12
13
class ClientTest extends TestCase
14
{
15
    private $httpClient;
16
    private $hydrator;
17
    private $requestBuilder;
18
19
    public function setUp()
20
    {
21
        $this->httpClient = m::mock(HttpClient::class);
22
        $this->hydrator = m::mock(HydratorInterface::class);
23
        $this->requestBuilder = m::mock(RequestBuilder::class);
24
    }
25
26
    public function testCreate()
27
    {
28
        $client = Client::create('username', 'password');
29
        $this->assertInstanceOf(Client::class, $client);
30
    }
31
32
    public function testTone()
33
    {
34
        $client = new Client($this->httpClient, $this->hydrator, $this->requestBuilder);
35
36
        $this->assertInstanceOf(Tone::class, $client->tone());
37
    }
38
}