GithubRepoConverterTest   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

Changes 2
Bugs 0 Features 1
Metric Value
wmc 4
c 2
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
3
namespace tests\DevBoardLib\GithubObjectApiFacade\Repo\Repo\Converter;
4
5
use DevBoardLib\GithubObjectApiFacade\Repo\Repo\Converter\GithubRepoConverter;
6
use Mockery as m;
7
use tests\DevBoardLib\GithubObjectApiFacade\JsonSampleDataProvider;
8
9
/**
10
 * Class GithubRepoConverterTest.
11
 */
12
class GithubRepoConverterTest extends \PHPUnit_Framework_TestCase
13
{
14
    /**
15
     * @dataProvider  provideConversionData
16
     *
17
     * @param $repoData
18
     */
19
    public function testConvert($repoData)
20
    {
21
        $repo = $this->provideTestRepo();
22
23
        $target = new GithubRepoConverter($repo);
0 ignored issues
show
Unused Code introduced by
The call to GithubRepoConverter::__construct() has too many arguments starting with $repo.

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
24
25
        self::assertInstanceOf(
26
            'DevBoardLib\GithubCore\Repo\GithubRepoSource',
27
            $target->convert($repoData)
28
        );
29
    }
30
31
    /**
32
     * @return array
33
     */
34
    public function provideConversionData()
35
    {
36
        return [
37
            [$this->getDataProvider()->getRepoDetails()],
38
        ];
39
    }
40
41
    /**
42
     * @return m\MockInterface
43
     */
44
    protected function provideTestRepo()
45
    {
46
        return m::mock('DevBoardLib\GithubCore\Repo\GithubRepo');
47
    }
48
49
    /**
50
     * @return JsonSampleDataProvider
51
     */
52
    protected function getDataProvider()
53
    {
54
        return new JsonSampleDataProvider();
55
    }
56
}
57