File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff 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 ));
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments