diff --git a/lib/Github/Api/Organization.php b/lib/Github/Api/Organization.php index 71f948dcb0b..077211a4987 100644 --- a/lib/Github/Api/Organization.php +++ b/lib/Github/Api/Organization.php @@ -51,13 +51,15 @@ public function update($organization, array $params) * * @param string $organization the user name * @param string $type the type of repositories + * @param int $page the page * * @return array the repositories */ - public function repositories($organization, $type = 'all') + public function repositories($organization, $type = 'all', $page = 1) { return $this->get('/orgs/'.rawurlencode($organization).'/repos', array( - 'type' => $type + 'type' => $type, + 'page' => $page, )); } diff --git a/test/Github/Tests/Api/OrganizationTest.php b/test/Github/Tests/Api/OrganizationTest.php index 3d3aaee998c..2090827655a 100644 --- a/test/Github/Tests/Api/OrganizationTest.php +++ b/test/Github/Tests/Api/OrganizationTest.php @@ -62,7 +62,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', 'page' => 1)) ->will($this->returnValue($expectedArray)); $this->assertEquals($expectedArray, $api->repositories('KnpLabs'));