GithubCommitConverterSpec   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 5
c 1
b 0
f 1
lcom 0
cbo 3
dl 0
loc 34
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A it_is_initializable() 0 4 1
A let() 0 5 1
A it_returns_github_commit_source_as_result() 0 5 1
A provideCommitDetails() 0 6 1
A getDataProvider() 0 4 1
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