Skip to content

Commit e964637

Browse files
author
corbosman
committed
list all organizations
1 parent 4176d3e commit e964637

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

lib/Github/Api/Organization.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,16 @@
1515
*/
1616
class 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()
24+
{
25+
return $this->get('organizations');
26+
}
27+
1828
/**
1929
* Get extended information about an organization by its name.
2030
*

test/Github/Tests/Api/OrganizationTest.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,22 @@
44

55
class 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')
18+
->will($this->returnValue($expectedValue));
19+
20+
$this->assertEquals($expectedValue, $api->all());
21+
}
22+
723
/**
824
* @test
925
*/

0 commit comments

Comments
 (0)