Skip to content

Commit 5532f80

Browse files
committed
Last missing gists method, closes #143
1 parent 3622ddc commit 5532f80

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

lib/Github/Api/Gists.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ public function fork($id)
5454
return $this->post('gists/'.rawurlencode($id).'/fork');
5555
}
5656

57+
public function forks($id)
58+
{
59+
return $this->get('gists/'.rawurlencode($id).'/forks');
60+
}
61+
5762
public function remove($id)
5863
{
5964
return $this->delete('gists/'.rawurlencode($id));

test/Github/Tests/Api/GistsTest.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,22 @@ public function shouldForkGist()
9494
$this->assertEquals($expectedArray, $api->fork(123));
9595
}
9696

97+
/**
98+
* @test
99+
*/
100+
public function shouldListGistForks()
101+
{
102+
$expectedArray = array('id' => '123');
103+
104+
$api = $this->getApiMock();
105+
$api->expects($this->once())
106+
->method('post')
107+
->with('gists/123/forks')
108+
->will($this->returnValue($expectedArray));
109+
110+
$api->forks(123);
111+
}
112+
97113
/**
98114
* @test
99115
* @expectedException Github\Exception\MissingArgumentException

0 commit comments

Comments
 (0)