@@ 12-32 (lines=21) @@ | ||
9 | ||
10 | class SimpleRepoFacadeTest extends \PHPUnit_Framework_TestCase |
|
11 | { |
|
12 | public function testFetchAllMilestones() |
|
13 | { |
|
14 | $wrapped = m::mock('DevBoardLib\GithubApiFacade\Repo\RepoFacade'); |
|
15 | $wrapped->shouldReceive('fetchAllMilestones') |
|
16 | ->andReturn($this->getDataProvider()->getAllMilestones()); |
|
17 | ||
18 | $target = new SimpleRepoFacade( |
|
19 | $wrapped, |
|
20 | new GithubIssueConverter($this->provideTestRepo()), |
|
21 | new GithubMilestoneConverter($this->provideTestRepo()) |
|
22 | ); |
|
23 | ||
24 | $milestones = $target->fetchAllMilestones(); |
|
25 | ||
26 | foreach ($milestones as $milestone) { |
|
27 | self::assertInstanceOf( |
|
28 | 'DevBoardLib\GithubObjectApiFacade\Repo\Milestone\GithubMilestoneSource', |
|
29 | $milestone |
|
30 | ); |
|
31 | } |
|
32 | } |
|
33 | ||
34 | public function testFetchAllIssues() |
|
35 | { |
|
@@ 34-55 (lines=22) @@ | ||
31 | } |
|
32 | } |
|
33 | ||
34 | public function testFetchAllIssues() |
|
35 | { |
|
36 | $wrapped = m::mock('DevBoardLib\GithubApiFacade\Repo\RepoFacade'); |
|
37 | ||
38 | $wrapped->shouldReceive('fetchAllIssues') |
|
39 | ->andReturn($this->getDataProvider()->getAllIssues()); |
|
40 | ||
41 | $target = new SimpleRepoFacade( |
|
42 | $wrapped, |
|
43 | new GithubIssueConverter($this->provideTestRepo()), |
|
44 | new GithubMilestoneConverter($this->provideTestRepo()) |
|
45 | ); |
|
46 | ||
47 | $issues = $target->fetchAllIssues(); |
|
48 | ||
49 | foreach ($issues as $issue) { |
|
50 | self::assertInstanceOf( |
|
51 | 'DevBoardLib\GithubObjectApiFacade\Repo\Issue\GithubIssueSource', |
|
52 | $issue |
|
53 | ); |
|
54 | } |
|
55 | } |
|
56 | ||
57 | protected function getDataProvider() |
|
58 | { |