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 1515 */
1616class Organization extends AbstractApi
1717{
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+
1828 /**
1929 * Get extended information about an organization by its name.
2030 *
Original file line number Diff line number Diff line change 44
55class OrganizationTest extends TestCase
66{
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+
723 /**
824 * @test
925 */
You can’t perform that action at this time.
0 commit comments