Code Duplication    Length = 16-18 lines in 5 locations

tests/Repo/SimpleRepoFacadeTest.php 5 locations

@@ 52-67 (lines=16) @@
49
        );
50
    }
51
52
    public function testFetchAllBranches()
53
    {
54
        $wrapped = m::mock('DevBoardLib\GithubApiFacade\Repo\RepoFacade');
55
        $wrapped->shouldReceive('fetchAllBranches')
56
            ->andReturn($this->getDataProvider()->getAllBranches());
57
58
        $target   = $this->createFacade($wrapped);
59
        $branches = $target->fetchAllBranches();
60
61
        foreach ($branches as $branch) {
62
            self::assertInstanceOf(
63
                'DevBoardLib\GithubCore\Branch\GithubBranchSource',
64
                $branch
65
            );
66
        }
67
    }
68
69
    public function testFetchAllTags()
70
    {
@@ 69-84 (lines=16) @@
66
        }
67
    }
68
69
    public function testFetchAllTags()
70
    {
71
        $wrapped = m::mock('DevBoardLib\GithubApiFacade\Repo\RepoFacade');
72
        $wrapped->shouldReceive('fetchAllTags')
73
            ->andReturn($this->getDataProvider()->getAllTagNames());
74
75
        $target   = $this->createFacade($wrapped);
76
        $branches = $target->fetchAllTags();
77
78
        foreach ($branches as $branch) {
79
            self::assertInstanceOf(
80
                'DevBoardLib\GithubCore\Tag\GithubTagSource',
81
                $branch
82
            );
83
        }
84
    }
85
86
    public function testFetchCommit()
87
    {
@@ 141-156 (lines=16) @@
138
    //
139
    //
140
141
    public function testFetchAllPullRequests()
142
    {
143
        $wrapped = m::mock('DevBoardLib\GithubApiFacade\Repo\RepoFacade');
144
        $wrapped->shouldReceive('fetchAllPullRequests')
145
            ->andReturn($this->getDataProvider()->getAllPullRequests());
146
147
        $target       = $this->createFacade($wrapped);
148
        $pullRequests = $target->fetchAllPullRequests();
149
150
        foreach ($pullRequests as $pullRequest) {
151
            self::assertInstanceOf(
152
                'DevBoardLib\GithubCore\PullRequest\GithubPullRequestSource',
153
                $pullRequest
154
            );
155
        }
156
    }
157
158
    public function testFetchAllMilestones()
159
    {
@@ 158-174 (lines=17) @@
155
        }
156
    }
157
158
    public function testFetchAllMilestones()
159
    {
160
        $wrapped = m::mock('DevBoardLib\GithubApiFacade\Repo\RepoFacade');
161
        $wrapped->shouldReceive('fetchAllMilestones')
162
            ->andReturn($this->getDataProvider()->getAllMilestones());
163
164
        $target = $this->createFacade($wrapped);
165
166
        $milestones = $target->fetchAllMilestones();
167
168
        foreach ($milestones as $milestone) {
169
            self::assertInstanceOf(
170
                'DevBoardLib\GithubCore\Milestone\GithubMilestoneSource',
171
                $milestone
172
            );
173
        }
174
    }
175
176
    public function testFetchAllIssues()
177
    {
@@ 176-193 (lines=18) @@
173
        }
174
    }
175
176
    public function testFetchAllIssues()
177
    {
178
        $wrapped = m::mock('DevBoardLib\GithubApiFacade\Repo\RepoFacade');
179
180
        $wrapped->shouldReceive('fetchAllIssues')
181
            ->andReturn($this->getDataProvider()->getAllIssues());
182
183
        $target = $this->createFacade($wrapped);
184
185
        $issues = $target->fetchAllIssues();
186
187
        foreach ($issues as $issue) {
188
            self::assertInstanceOf(
189
                'DevBoardLib\GithubCore\Issue\GithubIssueSource',
190
                $issue
191
            );
192
        }
193
    }
194
195
    /**
196
     * @param $wrapped