fixed search

This commit is contained in:
Simon Pocrnjič
2025-12-02 20:24:57 +01:00
parent 44f9f8f9fa
commit fb7160eb33
3 changed files with 164 additions and 4 deletions
+18
View File
@@ -0,0 +1,18 @@
<?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();
});