File tree Expand file tree Collapse file tree 3 files changed +27
-0
lines changed Expand file tree Collapse file tree 3 files changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,12 @@ $gists = $github->api('gists')->all();
3333$gist = $github->api('gists')->show(1);
3434```
3535
36+ #### Get commits for a single gist
37+
38+ ``` php
39+ $commits = $github->api('gists')->commits(1);
40+ ```
41+
3642#### Create a gist
3743
3844``` php
Original file line number Diff line number Diff line change @@ -44,6 +44,11 @@ public function update($id, array $params)
4444 return $ this ->patch ('gists/ ' .rawurlencode ($ id ), $ params );
4545 }
4646
47+ public function commits ($ id )
48+ {
49+ return $ this ->get ('gists/ ' .rawurlencode ($ id ).'/commits ' );
50+ }
51+
4752 public function fork ($ id )
4853 {
4954 return $ this ->post ('gists/ ' .rawurlencode ($ id ).'/fork ' );
Original file line number Diff line number Diff line change @@ -52,6 +52,22 @@ public function shouldShowGist()
5252 $ this ->assertEquals ($ expectedArray , $ api ->show (123 ));
5353 }
5454
55+ /**
56+ * @test
57+ */
58+ public function shouldShowCommits ()
59+ {
60+ $ expectedArray = array ('id ' => '123 ' );
61+
62+ $ api = $ this ->getApiMock ();
63+ $ api ->expects ($ this ->once ())
64+ ->method ('get ' )
65+ ->with ('gists/123/commits ' )
66+ ->will ($ this ->returnValue ($ expectedArray ));
67+
68+ $ this ->assertEquals ($ expectedArray , $ api ->commits (123 ));
69+ }
70+
5571 /**
5672 * @test
5773 */
You can’t perform that action at this time.
0 commit comments