Completed
Push — master ( 12f683...a4b1f6 )
by Miro
02:18
created

GithubIssueConverterTest::provideTestRepo()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 4
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 4
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
namespace tests\DevBoardLib\GithubObjectApiFacade\Repo\Issue\Converter;
3
4
use DevBoardLib\GithubObjectApiFacade\Repo\Issue\Converter\GithubIssueConverter;
5
use Mockery as m;
6
use tests\DevBoardLib\GithubObjectApiFacade\SampleDataProvider;
7
8 View Code Duplication
class GithubIssueConverterTest extends \PHPUnit_Framework_TestCase
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
9
{
10
    /**
11
     * @dataProvider  provideConversionData
12
     *
13
     * @param array $issueData
14
     */
15
    public function testConvert(array $issueData)
16
    {
17
        $repo = $this->provideTestRepo();
18
19
        $target = new GithubIssueConverter($repo);
20
21
        self::assertInstanceOf(
22
            'DevBoardLib\GithubObjectApiFacade\Repo\Issue\GithubIssueSource',
23
            $target->convert($issueData)
24
        );
25
    }
26
27
    public function provideConversionData()
28
    {
29
        $testData = [];
30
31
        foreach ($this->getDataProvider()->getAllIssues() as $item) {
32
            $testData[] = [$item];
33
        }
34
35
        return $testData;
36
    }
37
38
    protected function provideTestRepo()
39
    {
40
        return m::mock('DevBoardLib\GithubCore\Repo\GithubRepo');
41
    }
42
43
    protected function getDataProvider()
44
    {
45
        return new SampleDataProvider();
46
    }
47
}
48