Completed
Push — develop ( bc21b0...0bdfd4 )
by Adam
24:26 queued 09:29
created

ClientTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 4
dl 0
loc 25
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 testClassify() 0 5 1
1
<?php
2
3
namespace IBM\Watson\VisualRecognition\tests;
4
5
use Http\Client\HttpClient;
6
use IBM\Watson\Common\Hydrator\HydratorInterface;
7
use IBM\Watson\Common\RequestBuilder;
8
use IBM\Watson\VisualRecognition\Api\Classify;
9
use IBM\Watson\VisualRecognition\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(new RequestBuilder);
24
    }
25
26
    public function testCreate()
27
    {
28
        $client = Client::create('123');
29
        $this->assertInstanceOf(Client::class, $client);
30
    }
31
32
    public function testClassify()
33
    {
34
        $client = Client::create('123');
35
        $this->assertInstanceOf(Classify::class, $client->classify());
36
    }
37
}
38