From 5cc41babd87e074991e69d3a829c2955ad8d604e Mon Sep 17 00:00:00 2001 From: philipp lang Date: Fri, 11 Nov 2022 00:13:09 +0100 Subject: [PATCH] Return fake when destroySuccessfully called on fake --- src/Fakes/MembershipFake.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Fakes/MembershipFake.php b/src/Fakes/MembershipFake.php index c27511e..0f52c50 100644 --- a/src/Fakes/MembershipFake.php +++ b/src/Fakes/MembershipFake.php @@ -152,13 +152,15 @@ class MembershipFake extends Fake }); } - public function deletesSuccessfully(int $memberId, int $membershipId): void + public function destroysSuccessfully(int $memberId, int $membershipId): self { Http::fake(function ($request) use ($memberId, $membershipId) { if ($request->url() === "https://nami.dpsg.de/ica/rest/nami/zugeordnete-taetigkeiten/filtered-for-navigation/gruppierung-mitglied/mitglied/{$memberId}/{$membershipId}" && 'DELETE' === $request->method()) { return $this->nullResponse(); } }); + + return $this; } public function failsDeleting(int $memberId, ?int $membershipId): void