| @@ 37-50 (lines=14) @@ | ||
| 34 | ); |
|
| 35 | } |
|
| 36 | ||
| 37 | public function testFetchBranch() |
|
| 38 | { |
|
| 39 | $wrapped = m::mock('DevBoardLib\GithubApiFacade\Repo\RepoFacade'); |
|
| 40 | $wrapped->shouldReceive('fetchBranch') |
|
| 41 | ->with('master') |
|
| 42 | ->andReturn($this->getDataProvider()->getBranch()); |
|
| 43 | ||
| 44 | $target = $this->createFacade($wrapped); |
|
| 45 | ||
| 46 | self::assertInstanceOf( |
|
| 47 | 'DevBoardLib\GithubCore\Branch\GithubBranchSource', |
|
| 48 | $target->fetchBranch('master') |
|
| 49 | ); |
|
| 50 | } |
|
| 51 | ||
| 52 | public function testFetchAllBranches() |
|
| 53 | { |
|
| @@ 86-99 (lines=14) @@ | ||
| 83 | } |
|
| 84 | } |
|
| 85 | ||
| 86 | public function testFetchCommit() |
|
| 87 | { |
|
| 88 | $wrapped = m::mock('DevBoardLib\GithubApiFacade\Repo\RepoFacade'); |
|
| 89 | $wrapped->shouldReceive('fetchCommit') |
|
| 90 | ->with('sha123') |
|
| 91 | ->andReturn($this->getDataProvider()->getCommit()); |
|
| 92 | ||
| 93 | $target = $this->createFacade($wrapped); |
|
| 94 | ||
| 95 | self::assertInstanceOf( |
|
| 96 | 'DevBoardLib\GithubCore\Commit\GithubCommitSource', |
|
| 97 | $target->fetchCommit('sha123') |
|
| 98 | ); |
|
| 99 | } |
|
| 100 | ||
| 101 | /** |
|
| 102 | */ |
|
| @@ 103-118 (lines=16) @@ | ||
| 100 | ||
| 101 | /** |
|
| 102 | */ |
|
| 103 | public function testFetchCommitStatus() |
|
| 104 | { |
|
| 105 | $wrapped = m::mock('DevBoardLib\GithubApiFacade\Repo\RepoFacade'); |
|
| 106 | $wrapped->shouldReceive('fetchCommitStatus') |
|
| 107 | ->with('sha123') |
|
| 108 | ->andReturn($this->getDataProvider()->getCommitStatus()); |
|
| 109 | ||
| 110 | $target = $this->createFacade($wrapped); |
|
| 111 | ||
| 112 | foreach ($target->fetchCommitStatus('sha123') as $status) { |
|
| 113 | self::assertInstanceOf( |
|
| 114 | 'DevBoardLib\GithubCore\CommitStatus\GithubCommitStatusSource', |
|
| 115 | $status |
|
| 116 | ); |
|
| 117 | } |
|
| 118 | } |
|
| 119 | ||
| 120 | public function testFetchCommitStatuses() |
|
| 121 | { |
|
| @@ 120-135 (lines=16) @@ | ||
| 117 | } |
|
| 118 | } |
|
| 119 | ||
| 120 | public function testFetchCommitStatuses() |
|
| 121 | { |
|
| 122 | $wrapped = m::mock('DevBoardLib\GithubApiFacade\Repo\RepoFacade'); |
|
| 123 | $wrapped->shouldReceive('fetchCommitStatuses') |
|
| 124 | ->with('sha123') |
|
| 125 | ->andReturn($this->getDataProvider()->getCommitStatuses()); |
|
| 126 | ||
| 127 | $target = $this->createFacade($wrapped); |
|
| 128 | ||
| 129 | foreach ($target->fetchCommitStatuses('sha123') as $status) { |
|
| 130 | self::assertInstanceOf( |
|
| 131 | 'DevBoardLib\GithubCore\CommitStatus\GithubCommitStatusSource', |
|
| 132 | $status |
|
| 133 | ); |
|
| 134 | } |
|
| 135 | } |
|
| 136 | // |
|
| 137 | // |
|
| 138 | // |
|