Skip to content

Commit

Permalink
Add the ability to change the HTTP method used (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisnharvey authored Jun 30, 2020
1 parent 07d377c commit 95d3ea9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Bridge/TestCaseTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
trait TestCaseTrait
{
protected static $endpoint = '/graphql';

protected static $method = 'POST';

/**
* @var array
Expand All @@ -22,7 +24,7 @@ trait TestCaseTrait
public function query(QueryInterface $query, array $files = [], array $headers = [], array $cookies = [])
{
return $this->call(
'POST',
static::$method,
static::$endpoint,
['query' => $query()],
$cookies,
Expand All @@ -34,7 +36,7 @@ public function query(QueryInterface $query, array $files = [], array $headers =
public function mutation(MutationInterface $mutation, array $files = [], array $headers = [], array $cookies = [])
{
return $this->call(
'POST',
static::$method,
static::$endpoint,
['query' => $mutation()],
$cookies,
Expand Down

0 comments on commit 95d3ea9

Please sign in to comment.