diff options
Diffstat (limited to 'tests/PHPUnit/TestCases/HttpResponseTestCase.php')
-rw-r--r-- | tests/PHPUnit/TestCases/HttpResponseTestCase.php | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/tests/PHPUnit/TestCases/HttpResponseTestCase.php b/tests/PHPUnit/TestCases/HttpResponseTestCase.php deleted file mode 100644 index 31dc1d7..0000000 --- a/tests/PHPUnit/TestCases/HttpResponseTestCase.php +++ /dev/null @@ -1,37 +0,0 @@ -<?php - -namespace Tests\PHPUnit\TestCases; - -use GuzzleHttp\Client; -use GuzzleHttp\Psr7\Response; -use PHPUnit\Framework\TestCase; - -class HttpResponseTestCase extends TestCase -{ - protected Client $client; - - protected function setUp(): void - { - $this->client = new Client([ - "base_uri" => "http://localhost:8080", - ]); - } - - /** - * @param array $options - */ - public function request(string $method, string $path, array $options = []): Response - { - return $this->client->request( - $method, - $path, - ["http_errors" => false] + $options - ); - } - - public function hasJsonBody(Response $response): bool - { - json_decode((string)$response->getBody()); - return json_last_error() === JSON_ERROR_NONE; - } -} |