Add failure for creation

This commit is contained in:
philipp lang 2021-11-19 23:13:55 +01:00
parent 90d91088a9
commit 1238309006
1 changed files with 9 additions and 0 deletions

View File

@ -20,6 +20,15 @@ class CourseFake extends Fake {
});
}
public function doesntCreateWithError(int $memberId): void
{
Http::fake(function($request) use ($memberId) {
if ($request->url() === "https://nami.dpsg.de/ica/rest/nami/mitglied-ausbildung/filtered-for-navigation/mitglied/mitglied/{$memberId}") {
return Http::response('{"success":false,"data":null,"responseType":"EXCEPTION","message":"Unexpected Error javax.ejb.EJBException","title":null}', 200);
}
});
}
/**
* @param int $memberId
* @param array<string, mixed> $payload