Return fake when destroySuccessfully called on fake

This commit is contained in:
philipp lang 2022-11-11 00:13:09 +01:00
parent 8cf7bd2cf2
commit 5cc41babd8
1 changed files with 3 additions and 1 deletions

View File

@ -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