From 9ef0fe784c9ad5019f433560fbba07822e5e5ccf Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Mon, 6 May 2024 13:25:01 +0200 Subject: [PATCH] tests: use proper content type for no-auth test requests --- tests/ApiTest.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/ApiTest.php b/tests/ApiTest.php index 2821161..d460bf0 100644 --- a/tests/ApiTest.php +++ b/tests/ApiTest.php @@ -19,7 +19,8 @@ public function testNotAuth() $path = str_replace('.{_format}', '', $path); foreach ($route->getMethods() as $method) { $client = self::createClient(); - $response = $client->request($method, $path.'?sublibrary=1234'); + $contentType = ($method === 'PATCH') ? 'application/merge-patch+json' : 'application/ld+json'; + $response = $client->request($method, $path.'?sublibrary=1234', ['headers' => ['Content-Type' => $contentType]]); $this->assertContains($response->getStatusCode(), [401, 404], $path); } }