Completed
Push — master ( 84bf1d...fc2ff6 )
by Miro
05:06 queued 02:14
created

GithubRepoConverterTest   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A testConvert() 0 11 1
A provideConversionData() 0 6 1
A provideTestRepo() 0 4 1
A getDataProvider() 0 4 1
1
<?php
2
namespace tests\DevBoardLib\GithubObjectApiFacade\Repo\Repo\Converter;
3
4
use DevBoardLib\GithubObjectApiFacade\Repo\Repo\Converter\GithubRepoConverter;
5
use Mockery as m;
6
use tests\DevBoardLib\GithubObjectApiFacade\SampleDataProvider;
7
8
/**
9
 * Class GithubRepoConverterTest.
10
 */
11
class GithubRepoConverterTest extends \PHPUnit_Framework_TestCase
12
{
13
    /**
14
     * @dataProvider  provideConversionData
15
     *
16
     * @param $repoData
17
     */
18
    public function testConvert($repoData)
19
    {
20
        $repo = $this->provideTestRepo();
21
22
        $target = new GithubRepoConverter($repo);
23
24
        self::assertInstanceOf(
25
            'DevBoardLib\GithubCore\Repo\GithubRepoSource',
26
            $target->convert($repoData)
27
        );
28
    }
29
30
    /**
31
     * @return array
32
     */
33
    public function provideConversionData()
34
    {
35
        return [
36
            $this->getDataProvider()->getRepoDetails(),
37
        ];
38
    }
39
40
    /**
41
     * @return m\MockInterface
42
     */
43
    protected function provideTestRepo()
44
    {
45
        return m::mock('DevBoardLib\GithubCore\Repo\GithubRepo');
46
    }
47
48
    /**
49
     * @return SampleDataProvider
50
     */
51
    protected function getDataProvider()
52
    {
53
        return new SampleDataProvider();
54
    }
55
}
56