File tree Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -71,6 +71,17 @@ public function organizations($username)
71
71
return $ this ->get ('/users/ ' .rawurlencode ($ username ).'/orgs ' );
72
72
}
73
73
74
+ /**
75
+ * Get user organizations
76
+ *
77
+ * @link https://developer.github.com/v3/orgs/#list-your-organizations
78
+ *
79
+ * @return array information about organizations that authenticated user belongs to
80
+ */
81
+ public function orgs ()
82
+ {
83
+ return $ this ->get ('/user/orgs ' );
84
+ }
74
85
/**
75
86
* Request the users that a specific user is following.
76
87
*
Original file line number Diff line number Diff line change @@ -42,7 +42,25 @@ public function shouldGetUserOrganizations()
42
42
43
43
$ this ->assertEquals ($ expectedArray , $ api ->organizations ('l3l0 ' ));
44
44
}
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
+ ));
45
55
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
+ }
46
64
/**
47
65
* @test
48
66
*/
You can’t perform that action at this time.
0 commit comments