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();
33
33
$gist = $github->api('gists')->show(1);
34
34
```
35
35
36
+ #### Get commits for a single gist
37
+
38
+ ``` php
39
+ $commits = $github->api('gists')->commits(1);
40
+ ```
41
+
36
42
#### Create a gist
37
43
38
44
``` php
Original file line number Diff line number Diff line change @@ -44,6 +44,11 @@ public function update($id, array $params)
44
44
return $ this ->patch ('gists/ ' .rawurlencode ($ id ), $ params );
45
45
}
46
46
47
+ public function commits ($ id )
48
+ {
49
+ return $ this ->get ('gists/ ' .rawurlencode ($ id ).'/commits ' );
50
+ }
51
+
47
52
public function fork ($ id )
48
53
{
49
54
return $ this ->post ('gists/ ' .rawurlencode ($ id ).'/fork ' );
Original file line number Diff line number Diff line change @@ -52,6 +52,22 @@ public function shouldShowGist()
52
52
$ this ->assertEquals ($ expectedArray , $ api ->show (123 ));
53
53
}
54
54
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
+
55
71
/**
56
72
* @test
57
73
*/
You can’t perform that action at this time.
0 commit comments