Completed
Pull Request — master (#1)
by Miro
03:33
created

GithubRepoSourceSpec   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 82
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A it_is_initializable() 0 5 1
B let() 0 35 1
B it_exposes_all_constructor_params_via_getters() 0 37 1
1
<?php
2
namespace spec\DevBoardLib\GithubObjectApiFacade\Repo\Repo;
3
4
use DateTime;
5
use DevBoardLib\GithubCore\Repo\GithubRepoId;
6
use DevBoardLib\GithubCore\User\GithubUser;
7
use DevBoardLib\GithubCore\User\GithubUserId;
8
use PhpSpec\ObjectBehavior;
9
use Prophecy\Argument;
10
11
class GithubRepoSourceSpec extends ObjectBehavior
12
{
13
    public function it_is_initializable()
14
    {
15
        $this->shouldHaveType('DevBoardLib\GithubObjectApiFacade\Repo\Repo\GithubRepoSource');
16
        $this->shouldHaveType('DevBoardLib\GithubCore\Repo\GithubRepo');
17
    }
18
19
    public function let(
20
        GithubRepoId $id,
21
        GithubUser $ownerUser,
22
        $owner,
23
        $name,
24
        $fullName,
25
        $htmlUrl,
26
        $description,
27
        $fork,
28
        $defaultBranch,
29
        $githubPrivate,
30
        $gitUrl,
31
        $sshUrl,
32
        DateTime $githubCreatedAt,
33
        DateTime $githubUpdatedAt,
34
        DateTime $githubPushedAt
35
    ) {
36
        $this->beConstructedWith(
37
            $id,
38
            $ownerUser,
39
            $owner,
40
            $name,
41
            $fullName,
42
            $htmlUrl,
43
            $description,
44
            $fork,
45
            $defaultBranch,
46
            $githubPrivate,
47
            $gitUrl,
48
            $sshUrl,
49
            $githubCreatedAt,
50
            $githubUpdatedAt,
51
            $githubPushedAt
52
        );
53
    }
54
55
    public function it_exposes_all_constructor_params_via_getters(
56
        $id,
57
        $ownerUser,
58
        $owner,
59
        $name,
60
        $fullName,
61
        $htmlUrl,
62
        $description,
63
        $fork,
64
        $defaultBranch,
65
        $githubPrivate,
66
        $gitUrl,
67
        $sshUrl,
68
        $githubCreatedAt,
69
        $githubUpdatedAt,
70
        $githubPushedAt,
71
        GithubUserId $ownerUserId
72
    ) {
73
        $ownerUser->getGithubUserId()->willReturn($ownerUserId);
74
75
        $this->getId()->shouldReturn($id);
76
        $this->getOwnerUserId()->shouldReturn($ownerUserId);
77
        $this->getOwnerUser()->shouldReturn($ownerUser);
78
        $this->getOwner()->shouldReturn($owner);
79
        $this->getName()->shouldReturn($name);
80
        $this->getFullName()->shouldReturn($fullName);
81
        $this->getHtmlUrl()->shouldReturn($htmlUrl);
82
        $this->getDescription()->shouldReturn($description);
83
        $this->getFork()->shouldReturn($fork);
84
        $this->getDefaultBranch()->shouldReturn($defaultBranch);
85
        $this->getGithubPrivate()->shouldReturn($githubPrivate);
86
        $this->getGitUrl()->shouldReturn($gitUrl);
87
        $this->getSshUrl()->shouldReturn($sshUrl);
88
        $this->getGithubCreatedAt()->shouldReturn($githubCreatedAt);
89
        $this->getGithubUpdatedAt()->shouldReturn($githubUpdatedAt);
90
        $this->getGithubPushedAt()->shouldReturn($githubPushedAt);
91
    }
92
}
93