Teren-app/tests/Feature/PersonSearchTest.php
Simon Pocrnjič fb7160eb33 fixed search
2025-12-02 20:24:57 +01:00

19 lines
472 B
PHP

<?php
use App\Models\Person\Person;
it('finds a person when the query uses the inverted name order', function (): void {
config()->set('scout.driver', 'collection');
$person = Person::factory()->create([
'first_name' => 'John',
'last_name' => 'Dou',
'full_name' => 'Dou John',
]);
$results = Person::search('John Dou')->get();
expect($results)->toHaveCount(1)
->and($results->first()->is($person))->toBeTrue();
});