Skip to content

Commit 4d411b3

Browse files
committed
Merge pull request KnpLabs#188 from nWidart/master
Handle the additional arguments correctly from the user->repositories()
2 parents 7574e92 + 406e848 commit 4d411b3

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lib/Github/Api/User.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,9 @@ public function subscriptions($username)
139139
public function repositories($username, $type = 'owner', $sort = 'full_name', $direction = 'asc')
140140
{
141141
return $this->get('users/'.rawurlencode($username).'/repos', array(
142-
$type,
143-
$sort,
144-
$direction
142+
'type' => $type,
143+
'sort' => $sort,
144+
'direction' => $direction
145145
));
146146
}
147147

test/Github/Tests/Api/UserTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ public function shouldGetUserRepositories()
139139
$api = $this->getApiMock();
140140
$api->expects($this->once())
141141
->method('get')
142-
->with('users/l3l0/repos', array('owner', 'full_name', 'asc'))
142+
->with('users/l3l0/repos', array('type' => 'owner', 'sort' => 'full_name', 'direction' => 'asc'))
143143
->will($this->returnValue($expectedArray));
144144

145145
$this->assertEquals($expectedArray, $api->repositories('l3l0'));

0 commit comments

Comments
 (0)