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