Skip to content

Commit 875971e

Browse files
MatissJanisNyholm
authored andcommitted
Add page variable to organization repo list (#518)
* Update Organization.php * Update OrganizationTest.php
1 parent 22d967d commit 875971e

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

lib/Github/Api/Organization.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,15 @@ public function update($organization, array $params)
5151
*
5252
* @param string $organization the user name
5353
* @param string $type the type of repositories
54+
* @param int $page the page
5455
*
5556
* @return array the repositories
5657
*/
57-
public function repositories($organization, $type = 'all')
58+
public function repositories($organization, $type = 'all', $page = 1)
5859
{
5960
return $this->get('/orgs/'.rawurlencode($organization).'/repos', array(
60-
'type' => $type
61+
'type' => $type,
62+
'page' => $page,
6163
));
6264
}
6365

test/Github/Tests/Api/OrganizationTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public function shouldGetOrganizationRepositories()
6262
$api = $this->getApiMock();
6363
$api->expects($this->once())
6464
->method('get')
65-
->with('/orgs/KnpLabs/repos', array('type' => 'all'))
65+
->with('/orgs/KnpLabs/repos', array('type' => 'all', 'page' => 1))
6666
->will($this->returnValue($expectedArray));
6767

6868
$this->assertEquals($expectedArray, $api->repositories('KnpLabs'));

0 commit comments

Comments
 (0)