Skip to content

Commit 78aabb3

Browse files
committed
Add header to tests, API actually gives a 200 response
1 parent caeabff commit 78aabb3

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

Tests/Package/GraphqlTest.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ protected function setUp()
4343
*/
4444
public function testCreate()
4545
{
46-
$this->response->code = 201;
46+
$this->response->code = 200;
4747
$this->response->body = $this->sampleString;
4848

4949
// Build the query.
@@ -56,7 +56,8 @@ public function testCreate()
5656

5757
// Build the headers.
5858
$headers = array(
59-
'Accept' => 'application/vnd.github.v4+json',
59+
'Accept' => 'application/vnd.github.v4+json',
60+
'Content-Type' => 'application/json',
6061
);
6162

6263
$this->client->expects($this->once())
@@ -92,7 +93,8 @@ public function testCreateFailure()
9293

9394
// Build the headers.
9495
$headers = array(
95-
'Accept' => 'application/vnd.github.v4+json',
96+
'Accept' => 'application/vnd.github.v4+json',
97+
'Content-Type' => 'application/json',
9698
);
9799

98100
$this->client->expects($this->once())

src/Package/Graphql.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,7 @@ public function execute($query, array $variables = array())
5050

5151
// Send the request.
5252
return $this->processResponse(
53-
$this->client->post($this->fetchUrl($path), json_encode($data), $headers),
54-
201
53+
$this->client->post($this->fetchUrl($path), json_encode($data), $headers)
5554
);
5655
}
5756
}

0 commit comments

Comments
 (0)