Completed
Push — develop ( 2d2214...2a74ad )
by Adam
02:43
created

BasicAuthClientSpec   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 4
eloc 8
dl 0
loc 23
rs 10
c 0
b 0
f 0
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