File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change 15
15
*/
16
16
class Organization extends AbstractApi
17
17
{
18
+ /**
19
+ * @link https://developer.github.com/v3/orgs/#list-all-organizations
20
+ *
21
+ * @return array the organizations
22
+ */
23
+ public function all ($ since = '' )
24
+ {
25
+ return $ this ->get ('organizations?since= ' .rawurlencode ($ since ));
26
+ }
27
+
18
28
/**
19
29
* Get extended information about an organization by its name.
20
30
*
Original file line number Diff line number Diff line change 4
4
5
5
class OrganizationTest extends TestCase
6
6
{
7
+ /**
8
+ * @test
9
+ */
10
+ public function shouldGetAllOrganizations ()
11
+ {
12
+ $ expectedValue = array (array ('login ' => 'KnpLabs ' ));
13
+
14
+ $ api = $ this ->getApiMock ();
15
+ $ api ->expects ($ this ->once ())
16
+ ->method ('get ' )
17
+ ->with ('organizations?since=1 ' )
18
+ ->will ($ this ->returnValue ($ expectedValue ));
19
+
20
+ $ this ->assertEquals ($ expectedValue , $ api ->all (1 ));
21
+ }
22
+
7
23
/**
8
24
* @test
9
25
*/
You can’t perform that action at this time.
0 commit comments