From 7c25f51119031717ea45a5bedf968d6d57099d2f Mon Sep 17 00:00:00 2001 From: Chris Gmyr Date: Wed, 1 Jul 2015 17:10:14 -0400 Subject: [PATCH] added "body" for correct json schema --- lib/Github/Api/Gist/Comments.php | 4 ++-- test/Github/Tests/Api/Gist/CommentsTest.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/Github/Api/Gist/Comments.php b/lib/Github/Api/Gist/Comments.php index 2d889650015..9d439290f2c 100644 --- a/lib/Github/Api/Gist/Comments.php +++ b/lib/Github/Api/Gist/Comments.php @@ -22,12 +22,12 @@ public function show($gist, $comment) public function create($gist, $body) { - return $this->post('gists/'.rawurlencode($gist).'/comments', array($body)); + return $this->post('gists/'.rawurlencode($gist).'/comments', array('body' => $body)); } public function update($gist, $comment_id, $body) { - return $this->patch('gists/'.rawurlencode($gist).'/comments/'.rawurlencode($comment_id), array($body)); + return $this->patch('gists/'.rawurlencode($gist).'/comments/'.rawurlencode($comment_id), array('body' => $body)); } public function remove($gist, $comment) diff --git a/test/Github/Tests/Api/Gist/CommentsTest.php b/test/Github/Tests/Api/Gist/CommentsTest.php index 77f3ca50faa..557fae070f0 100644 --- a/test/Github/Tests/Api/Gist/CommentsTest.php +++ b/test/Github/Tests/Api/Gist/CommentsTest.php @@ -48,7 +48,7 @@ public function shouldCreateGistComment() $api = $this->getApiMock(); $api->expects($this->once()) ->method('post') - ->with('gists/123/comments', array('Test body')) + ->with('gists/123/comments', array('body' => 'Test body')) ->will($this->returnValue($expectedValue)); $this->assertEquals($expectedValue, $api->create('123', 'Test body')); @@ -60,7 +60,7 @@ public function shouldCreateGistComment() public function shouldUpdateGistComment() { $expectedValue = array('comment1data'); - $data = array('body test'); + $data = array('body' => 'body test'); $api = $this->getApiMock(); $api->expects($this->once())