adrema/tests/EndToEnd/MemberSearchTest.php

31 lines
859 B
PHP
Raw Normal View History

2024-01-28 11:42:32 +01:00
<?php
namespace Tests\EndToEnd;
2024-08-30 22:04:14 +02:00
use App\Country;
2024-01-28 11:42:32 +01:00
use App\Member\Member;
use Tests\EndToEndTestCase;
class MemberSearchTest extends EndToEndTestCase
{
2024-08-30 22:04:14 +02:00
public function setUp(): void
{
parent::setUp();
Country::factory()->create(['name' => 'Deutschland']);
}
2024-01-28 11:42:32 +01:00
public function testItHandlesFullTextSearch(): void
{
$this->withoutExceptionHandling()->login()->loginNami();
Member::factory()->defaults()->count(2)->create(['firstname' => 'Alexander']);
Member::factory()->defaults()->create(['firstname' => 'Heinrich']);
sleep(1);
$this->post(route('member.search'), ['filter' => ['search' => 'Alexander']])
->assertJsonCount(2, 'data');
$this->post(route('member.search'), ['filter' => ['search' => 'Heinrich']])
->assertJsonCount(1, 'data');
}
}