Skip to content

Commit 3a78482

Browse files
authored
Add tests for orgs()
1 parent db686b6 commit 3a78482

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

test/Github/Tests/Api/UserTest.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,25 @@ public function shouldGetUserOrganizations()
4242

4343
$this->assertEquals($expectedArray, $api->organizations('l3l0'));
4444
}
45+
public function shouldGetUserOrgs()
46+
{
47+
$expectedArray = array(array(
48+
'id' => 202732,
49+
'url' => 'https://api.github.com/orgs/KnpLabs',
50+
'repos_url' => 'https://api.github.com/orgs/KnpLabs/repos',
51+
'events_url' => 'https://api.github.com/orgs/KnpLabs/events',
52+
'members_url' => 'https://api.github.com/orgs/KnpLabs/members{/member}',
53+
'public_members_url' => 'https://api.github.com/orgs/KnpLabs/public_members{/member}'
54+
));
4555

56+
$api = $this->getApiMock();
57+
$api->expects($this->once())
58+
->method('get')
59+
->with('/user/orgs')
60+
->will($this->returnValue($expectedArray));
61+
62+
$this->assertEquals($expectedArray, $api->orgs());
63+
}
4664
/**
4765
* @test
4866
*/

0 commit comments

Comments
 (0)