Completed
Push — master ( ae399a...84a10b )
by Miro
05:50
created

KnpLabsClientFactorySpec   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A it_is_initializable() 0 5 1
A it_will_return_token_authenticated_github_client() 0 5 1
A it_will_return_unauthenticated_github_client() 0 5 1
1
<?php
2
namespace spec\DevBoardLib\GithubApiFacade\Client;
3
4
use DevBoardLib\GithubApiFacade\Auth\GithubAccessToken;
5
use PhpSpec\ObjectBehavior;
6
use Prophecy\Argument;
7
8
class KnpLabsClientFactorySpec extends ObjectBehavior
9
{
10
    public function it_is_initializable()
11
    {
12
        $this->shouldHaveType('DevBoardLib\GithubApiFacade\Client\KnpLabsClientFactory');
13
        $this->shouldHaveType('DevBoardLib\GithubApiFacade\Client\ClientFactory');
14
    }
15
16
    public function it_will_return_token_authenticated_github_client(GithubAccessToken $user)
17
    {
18
        $this->createTokenAuthenticatedClient($user)
19
            ->shouldReturnAnInstanceOf('Github\Client');
20
    }
21
    public function it_will_return_unauthenticated_github_client()
22
    {
23
        $this->createUnauthenticatedClient()
24
            ->shouldReturnAnInstanceOf('Github\Client');
25
    }
26
}
27