UserFacadeFactoryTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 6

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 2
c 1
b 0
f 1
lcom 0
cbo 6
dl 0
loc 22
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testCreate() 0 8 1
A provideTestUser() 0 7 1
1
<?php
2
3
namespace tests\DevBoardLib\GithubApiFacade\User;
4
5
use DevBoardLib\GithubApiFacade\Client\KnpLabsClientFactory;
6
use DevBoardLib\GithubApiFacade\User\UserFacadeFactory;
7
use Mockery as m;
8
9
/**
10
 * Class UserFacadeFactoryTest.
11
 */
12
class UserFacadeFactoryTest extends \PHPUnit_Framework_TestCase
13
{
14
    public function testCreate()
15
    {
16
        $target = new UserFacadeFactory(new KnpLabsClientFactory());
17
18
        $result = $target->create($this->provideTestUser());
19
20
        self::assertInstanceOf('DevBoardLib\GithubApiFacade\User\PaginatedKnpLabsUserFacade', $result);
21
    }
22
23
    /**
24
     * @return \DevBoardLib\GithubApiFacade\Auth\GithubAccessToken
25
     */
26
    private function provideTestUser()
27
    {
28
        $user = m::mock('DevBoardLib\GithubApiFacade\Auth\GithubAccessToken');
29
        $user->shouldReceive('getGithubAccessToken')->andReturn(getenv('GITHUB_ACCESS_TOKEN'));
30
31
        return $user;
32
    }
33
}
34