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

BasicAuthClientSpec   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 1
dl 0
loc 25
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 4 1
A it_is_initializable() 0 5 1
A it_should_create_client() 0 4 1
A it_should_discover_http_client() 0 6 1
1
<?php
2
3
namespace spec\IBM\Watson\Common;
4
5
use Http\Client\HttpClient;
6
use IBM\Watson\Common\AbstractClient;
7
use IBM\Watson\Common\BasicAuthClient;
8
use PhpSpec\ObjectBehavior;
9
10
class BasicAuthClientSpec extends ObjectBehavior
11
{
12
    public function setUp(HttpClient $httpClient)
13
    {
14
        $this->beConstructedWith($httpClient);
15
    }
16
17
    public function it_is_initializable()
18
    {
19
        $this->shouldHaveType(BasicAuthClient::class);
20
        $this->shouldHaveType(AbstractClient::class);
21
    }
22
23
    public function it_should_create_client()
24
    {
25
        $this::create('username', 'password')->shouldReturnAnInstanceOf(BasicAuthClient::class);
26
    }
27
28
    public function it_should_discover_http_client()
29
    {
30
        $this::create('username', 'password')
31
            ->discoverHttpClient()
32
            ->shouldReturnAnInstanceOf(HttpClient::class);
33
    }
34
}
35