Skip to content

Commit 2c7ce8c

Browse files
committed
added test for User::organizations
1 parent 0e7c3ec commit 2c7ce8c

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

test/Github/Tests/Api/UserTest.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,29 @@ public function shouldShowUser()
2020
$this->assertEquals($expectedArray, $api->show('l3l0'));
2121
}
2222

23+
/**
24+
* @test
25+
*/
26+
public function shouldGetUserOrganizations()
27+
{
28+
$expectedArray = array(array(
29+
'id' => 202732,
30+
'url' => 'https://api.github.com/orgs/KnpLabs',
31+
'repos_url' => 'https://api.github.com/orgs/KnpLabs/repos',
32+
'events_url' => 'https://api.github.com/orgs/KnpLabs/events',
33+
'members_url' => 'https://api.github.com/orgs/KnpLabs/members{/member}',
34+
'public_members_url' => 'https://api.github.com/orgs/KnpLabs/public_members{/member}'
35+
));
36+
37+
$api = $this->getApiMock();
38+
$api->expects($this->once())
39+
->method('get')
40+
->with('users/l3l0/orgs')
41+
->will($this->returnValue($expectedArray));
42+
43+
$this->assertEquals($expectedArray, $api->organizations('l3l0'));
44+
}
45+
2346
/**
2447
* @test
2548
*/

0 commit comments

Comments
 (0)