Completed
Pull Request — master (#8)
by Miro
03:40
created

GithubCommitConverterSpec::it_is_initializable()   A

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