GithubRepoConverterTest::provideConversionData()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 6
rs 9.4285
cc 1
eloc 3
nc 1
nop 0
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