Fixed: ensure content-type is present when deleting membership

This commit is contained in:
philipp lang 2022-11-11 01:34:07 +01:00
parent 1a3f89ec4f
commit 4536e0907d
2 changed files with 5 additions and 2 deletions

View File

@ -494,7 +494,10 @@ class Api
private function delete(string $url, string $error): void private function delete(string $url, string $error): void
{ {
$response = $this->http()->delete($this->url.$url); $response = $this->http()->withHeaders([
'content-type' => 'application/json',
'accept' => 'application/json',
])->delete($this->url.$url);
if (null === $response->json()) { if (null === $response->json()) {
$this->exception($error, $url, []); $this->exception($error, $url, []);

View File

@ -176,7 +176,7 @@ class MembershipFake extends Fake
{ {
$url = "https://nami.dpsg.de/ica/rest/nami/zugeordnete-taetigkeiten/filtered-for-navigation/gruppierung-mitglied/mitglied/{$memberId}/{$membershipId}"; $url = "https://nami.dpsg.de/ica/rest/nami/zugeordnete-taetigkeiten/filtered-for-navigation/gruppierung-mitglied/mitglied/{$memberId}/{$membershipId}";
Http::assertSent(function ($request) use ($url) { Http::assertSent(function ($request) use ($url) {
return $request->url() === $url && 'DELETE' === $request->method(); return $request->hasHeader('content-type', 'application/json') && $request->hasHeader('content-type', 'application/json') && $request->url() === $url && 'DELETE' === $request->method();
}); });
} }