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

RepoFacadeFactorySpec   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 4 1
A let() 0 4 1
A it_will_create_repo_facade() 0 6 1
1
<?php
2
namespace spec\DevBoardLib\GithubApiFacade\Repo;
3
4
use DevBoardLib\GithubApiFacade\Auth\GithubAccessToken;
5
use DevBoardLib\GithubApiFacade\Client\ClientFactory;
6
use DevBoardLib\GithubCore\Repo\GithubRepo;
7
use Github\Client;
8
use PhpSpec\ObjectBehavior;
9
use Prophecy\Argument;
10
11
class RepoFacadeFactorySpec extends ObjectBehavior
12
{
13
    public function it_is_initializable()
14
    {
15
        $this->shouldHaveType('DevBoardLib\GithubApiFacade\Repo\RepoFacadeFactory');
16
    }
17
18
    public function let(ClientFactory $clientFactory)
19
    {
20
        $this->beConstructedWith($clientFactory);
21
    }
22
23
    public function it_will_create_repo_facade($clientFactory, GithubRepo $githubRepo, GithubAccessToken $user, Client $client)
24
    {
25
        $clientFactory->createTokenAuthenticatedClient($user)->willReturn($client);
26
        $this->create($githubRepo, $user)
27
            ->shouldReturnAnInstanceOf('DevBoardLib\GithubApiFacade\Repo\PaginatedKnpLabsRepoFacade');
28
    }
29
}
30