Skip to content

Commit 955326c

Browse files
author
Thomas Genin
committed
Merge pull request #1 from Expensify/joe-milestones
Adding get milestones for repository
2 parents d890eec + 61d6aa0 commit 955326c

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

lib/Github/Api/Repo.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -463,4 +463,14 @@ public function merge($username, $repository, $base, $head, $message = null)
463463
'commit_message' => $message
464464
));
465465
}
466+
467+
/**
468+
* @param string $username
469+
* @param string $repository
470+
* @return array
471+
*/
472+
public function milestones($username, $repository)
473+
{
474+
return $this->get('repos/'.rawurldecode($username).'/'.rawurldecode($repository).'/milestones');
475+
}
466476
}

test/Github/Tests/Api/RepoTest.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,22 @@ public function shouldGetRepositoryLanguages()
188188
$this->assertEquals($expectedArray, $api->languages('KnpLabs', 'php-github-api'));
189189
}
190190

191+
/**
192+
* @test
193+
*/
194+
public function shouldGetRepositoryMilestones()
195+
{
196+
$expectedArray = array('milestone1', 'milestone2');
197+
198+
$api = $this->getApiMock();
199+
$api->expects($this->once())
200+
->method('get')
201+
->with('repos/KnpLabs/php-github-api/milestones')
202+
->will($this->returnValue($expectedArray));
203+
204+
$this->assertEquals($expectedArray, $api->milestones('KnpLabs', 'php-github-api'));
205+
}
206+
191207
/**
192208
* @test
193209
*/

0 commit comments

Comments
 (0)