diff --git a/tests/Unit/SearchTest.php b/tests/Unit/SearchTest.php index ef6c507..9f012a4 100644 --- a/tests/Unit/SearchTest.php +++ b/tests/Unit/SearchTest.php @@ -52,11 +52,19 @@ class SearchTest extends TestCase $this->assertEquals(89418, $member->id); $this->assertEquals(100105, $member->groupId); $this->assertEquals(90166, $member->memberId); - Http::assertSent(function ($request) { - return $request->url() == $this->url(['mitgliedsNummber' => 150]) - && 'GET' == $request->method(); - }); + app(SearchFake::class)->assertFetched(1, 0, 100, ['mitgliedsNummber' => 150]); + Http::assertSentCount(1); + } + public function testItFindsMembersByGeneralSearch(): void + { + Http::fake([ + $this->url(['data' => 'A']) => Http::response($this->fakeJson('searchResponse.json'), 200), + ]); + + $member = $this->login()->find(['data' => 'A']); + + app(SearchFake::class)->assertFetched(1, 0, 100, ['data' => 'A']); Http::assertSentCount(1); }