Add update error fake

This commit is contained in:
philipp lang 2021-11-20 00:53:57 +01:00
parent 8614f81eca
commit 64ce14910a
1 changed files with 9 additions and 0 deletions

View File

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