From 95d3ea942cac403d8e3338be8fa545964307c546 Mon Sep 17 00:00:00 2001 From: Chris Harvey Date: Tue, 30 Jun 2020 10:59:07 +0100 Subject: [PATCH] Add the ability to change the HTTP method used (#1) --- src/Bridge/TestCaseTrait.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Bridge/TestCaseTrait.php b/src/Bridge/TestCaseTrait.php index c1b7ccf..5743ed8 100644 --- a/src/Bridge/TestCaseTrait.php +++ b/src/Bridge/TestCaseTrait.php @@ -13,6 +13,8 @@ trait TestCaseTrait { protected static $endpoint = '/graphql'; + + protected static $method = 'POST'; /** * @var array @@ -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, @@ -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,