Skip to content

Commit 42fadfe

Browse files
committed
Merge pull request #282 from cmgmyr/gist-comment-fix
fix json schema to add/update gist comments
2 parents ccf5e49 + 7c25f51 commit 42fadfe

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lib/Github/Api/Gist/Comments.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ public function show($gist, $comment)
2222

2323
public function create($gist, $body)
2424
{
25-
return $this->post('gists/'.rawurlencode($gist).'/comments', array($body));
25+
return $this->post('gists/'.rawurlencode($gist).'/comments', array('body' => $body));
2626
}
2727

2828
public function update($gist, $comment_id, $body)
2929
{
30-
return $this->patch('gists/'.rawurlencode($gist).'/comments/'.rawurlencode($comment_id), array($body));
30+
return $this->patch('gists/'.rawurlencode($gist).'/comments/'.rawurlencode($comment_id), array('body' => $body));
3131
}
3232

3333
public function remove($gist, $comment)

test/Github/Tests/Api/Gist/CommentsTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function shouldCreateGistComment()
4848
$api = $this->getApiMock();
4949
$api->expects($this->once())
5050
->method('post')
51-
->with('gists/123/comments', array('Test body'))
51+
->with('gists/123/comments', array('body' => 'Test body'))
5252
->will($this->returnValue($expectedValue));
5353

5454
$this->assertEquals($expectedValue, $api->create('123', 'Test body'));
@@ -60,7 +60,7 @@ public function shouldCreateGistComment()
6060
public function shouldUpdateGistComment()
6161
{
6262
$expectedValue = array('comment1data');
63-
$data = array('body test');
63+
$data = array('body' => 'body test');
6464

6565
$api = $this->getApiMock();
6666
$api->expects($this->once())

0 commit comments

Comments
 (0)