diff --git a/lib/Github/Api/Organization.php b/lib/Github/Api/Organization.php index 29f23ccf2d7..6c5cdc86b46 100644 --- a/lib/Github/Api/Organization.php +++ b/lib/Github/Api/Organization.php @@ -38,13 +38,15 @@ public function update($organization, array $params) * * @param string $organization the user name * @param string $type the type of repositories + * @param int $items_per_page the number of items per page * * @return array the repositories */ - public function repositories($organization, $type = 'all') + public function repositories($organization, $type = 'all', $items_per_page = 30) { return $this->get('orgs/'.urlencode($organization).'/repos', array( - 'type' => $type + 'type' => $type, + 'per_page' => $items_per_page, )); } diff --git a/test/Github/Tests/Api/OrganizationTest.php b/test/Github/Tests/Api/OrganizationTest.php index b1497c2f4c4..6017dcd3a13 100644 --- a/test/Github/Tests/Api/OrganizationTest.php +++ b/test/Github/Tests/Api/OrganizationTest.php @@ -46,7 +46,7 @@ public function shouldGetOrganizationRepositories() $api = $this->getApiMock(); $api->expects($this->once()) ->method('get') - ->with('orgs/KnpLabs/repos', array('type' => 'all')) + ->with('orgs/KnpLabs/repos', array('type' => 'all', 'per_page' => 30)) ->will($this->returnValue($expectedArray)); $this->assertEquals($expectedArray, $api->repositories('KnpLabs'));