Completed
Push — develop ( 2c75a2...3f95e8 )
by Adam
08:12
created

BasicAuthClientTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 4 1
A testCreate() 0 5 1
A testDiscoverHttpClient() 0 5 1
1
<?php
2
3
namespace IBM\Watson\Common\Tests;
4
5
use Http\Client\HttpClient;
6
use IBM\Watson\Common\AbstractClient;
7
use IBM\Watson\Common\BasicAuthClient;
8
use IBM\Watson\Common\BasicAuthClientInterface;
9
use PHPUnit\Framework\TestCase;
10
11
class BasicAuthClientTest extends TestCase
12
{
13
    private $client;
14
15
    public function setUp()
16
    {
17
        $this->client = BasicAuthClient::create('username', 'password');
18
    }
19
20
    public function testCreate()
21
    {
22
        $this->assertInstanceOf(AbstractClient::class, $this->client);
23
        $this->assertInstanceOf(BasicAuthClientInterface::class, $this->client);
24
    }
25
26
    public function testDiscoverHttpClient()
27
    {
28
        $httpClient = $this->client->discoverHttpClient();
29
        $this->assertInstanceOf(HttpClient::class, $httpClient);
30
    }
31
}
32