This commit is contained in:
philipp lang 2024-02-23 23:29:32 +01:00
parent af626f5d3a
commit b558766cdc
1 changed files with 3 additions and 3 deletions

View File

@ -11,7 +11,7 @@ class SearchFake extends Fake
public function fetchFails(int $page, int $start, int $perPage, ?string $error = 'wrong message'): void
{
Http::fake(function ($request) use ($error, $page, $start, $perPage) {
if ($request->url() === 'https://nami.dpsg.de/ica/rest/nami/search-multi/result-list?searchedValues='.rawurlencode('{}').'&page='.$page.'&start='.$start.'&limit='.$perPage) {
if ($request->url() === 'https://nami.dpsg.de/ica/rest/nami/search-multi/result-list?searchedValues=' . rawurlencode('{}') . '&page=' . $page . '&start=' . $start . '&limit=' . $perPage) {
return $this->errorResponse($error);
}
});
@ -23,7 +23,7 @@ class SearchFake extends Fake
public function fetches(int $page, int $start, int $perPage, array $data): void
{
Http::fake(function ($request) use ($page, $start, $data, $perPage) {
if (Str::endsWith($request->url(), '&page='.$page.'&start='.$start.'&limit='.$perPage)) {
if (Str::endsWith($request->url(), '&page=' . $page . '&start=' . $start . '&limit=' . $perPage)) {
return $this->collection(collect($data));
}
});
@ -35,7 +35,7 @@ class SearchFake extends Fake
public function assertFetched(int $page, int $start, int $perPage, array $data): void
{
Http::assertSent(function ($request) use ($page, $start, $perPage, $data) {
return $request->url() === 'https://nami.dpsg.de/ica/rest/nami/search-multi/result-list?searchedValues='.rawurlencode(json_encode((object) $data)).'&page='.$page.'&start='.$start.'&limit='.$perPage;
return $request->url() === 'https://nami.dpsg.de/ica/rest/nami/search-multi/result-list?searchedValues=' . rawurlencode(json_encode((object) $data)) . '&page=' . $page . '&start=' . $start . '&limit=' . $perPage;
});
}
}