16
16
use MongoDB \Database ;
17
17
use MongoDB \Driver \CursorInterface ;
18
18
use MongoDB \Laravel \Scout \ScoutEngine ;
19
- use MongoDB \Laravel \Tests \Models \SearchableInSameNamespace ;
20
- use MongoDB \Laravel \Tests \Models \SearchableModel ;
19
+ use MongoDB \Laravel \Tests \Scout \ Models \SearchableInSameNamespace ;
20
+ use MongoDB \Laravel \Tests \Scout \ Models \SearchableModel ;
21
21
use MongoDB \Laravel \Tests \TestCase ;
22
22
use MongoDB \Model \BSONDocument ;
23
23
use PHPUnit \Framework \Attributes \DataProvider ;
31
31
/** Unit tests that do not require an Atlas Search cluster */
32
32
class ScoutEngineTest extends TestCase
33
33
{
34
- private const EXPECTED_SEARCH_OPTIONS = ['typeMap ' => ['root ' => 'object ' , 'document ' => 'array ' , 'array ' => 'array ' ]];
34
+ private const EXPECTED_SEARCH_OPTIONS = ['typeMap ' => ['root ' => 'array ' , 'document ' => 'array ' , 'array ' => 'array ' ]];
35
35
36
36
/** @param callable(): Builder $builder */
37
37
#[DataProvider('provideSearchPipelines ' )]
@@ -41,7 +41,7 @@ public function testSearch(Closure $builder, array $expectedPipeline): void
41
41
$ database = m::mock (Database::class);
42
42
$ collection = m::mock (Collection::class);
43
43
$ database ->shouldReceive ('selectCollection ' )
44
- ->with ('table_searchable ' )
44
+ ->with ('collection_searchable ' )
45
45
->andReturn ($ collection );
46
46
$ cursor = m::mock (CursorInterface::class);
47
47
$ cursor ->shouldReceive ('toArray ' )->once ()->with ()->andReturn ($ data );
@@ -337,7 +337,7 @@ public function testPaginate()
337
337
$ collection = m::mock (Collection::class);
338
338
$ cursor = m::mock (CursorInterface::class);
339
339
$ database ->shouldReceive ('selectCollection ' )
340
- ->with ('table_searchable ' )
340
+ ->with ('collection_searchable ' )
341
341
->andReturn ($ collection );
342
342
$ collection ->shouldReceive ('aggregate ' )
343
343
->once ()
@@ -451,7 +451,7 @@ public function testUpdate(): void
451
451
$ database = m::mock (Database::class);
452
452
$ collection = m::mock (Collection::class);
453
453
$ database ->shouldReceive ('selectCollection ' )
454
- ->with ('table_indexable ' )
454
+ ->with ('collection_indexable ' )
455
455
->andReturn ($ collection );
456
456
$ collection ->shouldReceive ('bulkWrite ' )
457
457
->once ()
@@ -490,7 +490,7 @@ public function testUpdateWithSoftDelete(): void
490
490
$ database = m::mock (Database::class);
491
491
$ collection = m::mock (Collection::class);
492
492
$ database ->shouldReceive ('selectCollection ' )
493
- ->with ('table_indexable ' )
493
+ ->with ('collection_indexable ' )
494
494
->andReturn ($ collection );
495
495
$ collection ->shouldReceive ('bulkWrite ' )
496
496
->once ()
@@ -516,7 +516,7 @@ public function testDelete(): void
516
516
$ database = m::mock (Database::class);
517
517
$ collection = m::mock (Collection::class);
518
518
$ database ->shouldReceive ('selectCollection ' )
519
- ->with ('table_indexable ' )
519
+ ->with ('collection_indexable ' )
520
520
->andReturn ($ collection );
521
521
$ collection ->shouldReceive ('deleteMany ' )
522
522
->once ()
@@ -540,7 +540,7 @@ public function testDeleteWithRemoveableScoutCollection(): void
540
540
$ database = m::mock (Database::class);
541
541
$ collection = m::mock (Collection::class);
542
542
$ database ->shouldReceive ('selectCollection ' )
543
- ->with ('table_indexable ' )
543
+ ->with ('collection_indexable ' )
544
544
->andReturn ($ collection );
545
545
$ collection ->shouldReceive ('deleteMany ' )
546
546
->once ()
0 commit comments