1616use MongoDB \Database ;
1717use MongoDB \Driver \CursorInterface ;
1818use 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 ;
2121use MongoDB \Laravel \Tests \TestCase ;
2222use MongoDB \Model \BSONDocument ;
2323use PHPUnit \Framework \Attributes \DataProvider ;
3131/** Unit tests that do not require an Atlas Search cluster */
3232class ScoutEngineTest extends TestCase
3333{
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 ' ]];
3535
3636 /** @param callable(): Builder $builder */
3737 #[DataProvider('provideSearchPipelines ' )]
@@ -41,7 +41,7 @@ public function testSearch(Closure $builder, array $expectedPipeline): void
4141 $ database = m::mock (Database::class);
4242 $ collection = m::mock (Collection::class);
4343 $ database ->shouldReceive ('selectCollection ' )
44- ->with ('table_searchable ' )
44+ ->with ('collection_searchable ' )
4545 ->andReturn ($ collection );
4646 $ cursor = m::mock (CursorInterface::class);
4747 $ cursor ->shouldReceive ('toArray ' )->once ()->with ()->andReturn ($ data );
@@ -337,7 +337,7 @@ public function testPaginate()
337337 $ collection = m::mock (Collection::class);
338338 $ cursor = m::mock (CursorInterface::class);
339339 $ database ->shouldReceive ('selectCollection ' )
340- ->with ('table_searchable ' )
340+ ->with ('collection_searchable ' )
341341 ->andReturn ($ collection );
342342 $ collection ->shouldReceive ('aggregate ' )
343343 ->once ()
@@ -451,7 +451,7 @@ public function testUpdate(): void
451451 $ database = m::mock (Database::class);
452452 $ collection = m::mock (Collection::class);
453453 $ database ->shouldReceive ('selectCollection ' )
454- ->with ('table_indexable ' )
454+ ->with ('collection_indexable ' )
455455 ->andReturn ($ collection );
456456 $ collection ->shouldReceive ('bulkWrite ' )
457457 ->once ()
@@ -490,7 +490,7 @@ public function testUpdateWithSoftDelete(): void
490490 $ database = m::mock (Database::class);
491491 $ collection = m::mock (Collection::class);
492492 $ database ->shouldReceive ('selectCollection ' )
493- ->with ('table_indexable ' )
493+ ->with ('collection_indexable ' )
494494 ->andReturn ($ collection );
495495 $ collection ->shouldReceive ('bulkWrite ' )
496496 ->once ()
@@ -516,7 +516,7 @@ public function testDelete(): void
516516 $ database = m::mock (Database::class);
517517 $ collection = m::mock (Collection::class);
518518 $ database ->shouldReceive ('selectCollection ' )
519- ->with ('table_indexable ' )
519+ ->with ('collection_indexable ' )
520520 ->andReturn ($ collection );
521521 $ collection ->shouldReceive ('deleteMany ' )
522522 ->once ()
@@ -540,7 +540,7 @@ public function testDeleteWithRemoveableScoutCollection(): void
540540 $ database = m::mock (Database::class);
541541 $ collection = m::mock (Collection::class);
542542 $ database ->shouldReceive ('selectCollection ' )
543- ->with ('table_indexable ' )
543+ ->with ('collection_indexable ' )
544544 ->andReturn ($ collection );
545545 $ collection ->shouldReceive ('deleteMany ' )
546546 ->once ()
0 commit comments