Add searchTest for general search

This commit is contained in:
Philipp Lang 2023-05-08 14:49:54 +02:00
parent 2781810959
commit 33875d36fa
1 changed files with 12 additions and 4 deletions

View File

@ -52,11 +52,19 @@ class SearchTest extends TestCase
$this->assertEquals(89418, $member->id); $this->assertEquals(89418, $member->id);
$this->assertEquals(100105, $member->groupId); $this->assertEquals(100105, $member->groupId);
$this->assertEquals(90166, $member->memberId); $this->assertEquals(90166, $member->memberId);
Http::assertSent(function ($request) { app(SearchFake::class)->assertFetched(1, 0, 100, ['mitgliedsNummber' => 150]);
return $request->url() == $this->url(['mitgliedsNummber' => 150]) Http::assertSentCount(1);
&& 'GET' == $request->method(); }
});
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); Http::assertSentCount(1);
} }