From db014ebf9f8f84a1a0d0972298e70bf29e57c37e Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Tue, 26 Aug 2025 11:30:49 +0200 Subject: create .cache directory and move tests to Integration directory --- .../Integration/TestCases/HttpResponseTestCase.php | 37 ++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 tests/Integration/TestCases/HttpResponseTestCase.php (limited to 'tests/Integration/TestCases') diff --git a/tests/Integration/TestCases/HttpResponseTestCase.php b/tests/Integration/TestCases/HttpResponseTestCase.php new file mode 100644 index 0000000..43b4859 --- /dev/null +++ b/tests/Integration/TestCases/HttpResponseTestCase.php @@ -0,0 +1,37 @@ +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; + } +} -- cgit v1.2.3