GithubCommitConverterSpec::getDataProvider()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace spec\DevBoardLib\GithubObjectApiFacade\Repo\Commit\Converter;
4
5
use DevBoardLib\GithubCore\Repo\GithubRepo;
6
use DevBoardLib\GithubCore\Repo\GithubRepoId;
7
use PhpSpec\ObjectBehavior;
8
use Prophecy\Argument;
9
use tests\DevBoardLib\GithubObjectApiFacade\SampleDataProvider;
10
11
class GithubCommitConverterSpec extends ObjectBehavior
12
{
13
    public function it_is_initializable()
14
    {
15
        $this->shouldHaveType('DevBoardLib\GithubObjectApiFacade\Repo\Commit\Converter\GithubCommitConverter');
16
    }
17
18
    public function let(GithubRepo $githubRepo, GithubRepoId $repoId)
19
    {
20
        $githubRepo->getId()->willReturn($repoId);
21
        $this->beConstructedWith($githubRepo);
22
    }
23
24
    /**
25
     * @dataProvider provideCommitDetails
26
     */
27
    public function it_returns_github_commit_source_as_result($arrayData)
28
    {
29
        $result = $this->convert($arrayData);
30
        $result->shouldReturnAnInstanceOf('DevBoardLib\GithubCore\Commit\GithubCommitSource');
31
    }
32
33
    public function provideCommitDetails()
34
    {
35
        return [
36
            [$this->getDataProvider()->getCommit()],
37
        ];
38
    }
39
40
    protected function getDataProvider()
41
    {
42
        return new SampleDataProvider();
43
    }
44
}
45