1010use MongoDB \Builder \Search ;
1111use MongoDB \Driver \Exception \ServerException ;
1212use MongoDB \Laravel \Schema \Builder ;
13+ use MongoDB \Laravel \Tests \Models \Book ;
1314use MongoDB \Laravel \Tests \TestCase ;
15+ use PHPUnit \Framework \Attributes \Group ;
1416
1517use function array_map ;
1618use function mt_getrandmax ;
1921use function srand ;
2022use function usleep ;
2123
24+ #[Group('atlas-search ' )]
2225class AtlasSearchTest extends TestCase
2326{
2427 private array $ vectors ;
@@ -84,7 +87,7 @@ protected function setUp(): void
8487 do {
8588 $ ready = true ;
8689 usleep (10_000 );
87- foreach ($ collection ->listSearchIndexes () as $ index ) {
90+ foreach ($ moviesCollection ->listSearchIndexes () as $ index ) {
8891 if ($ index ['status ' ] !== 'READY ' ) {
8992 $ ready = false ;
9093 }
@@ -102,7 +105,7 @@ public function testSimpleSearch(): void
102105 $ movies = Movie::search (
103106 sort: ['title ' => 1 ],
104107 operator: Search::text ('title ' , 'dream ' ),
105- )->get ();
108+ )->all ();
106109 // end-search-query
107110
108111 $ this ->assertNotNull ($ movies );
@@ -113,10 +116,10 @@ public function testSimpleSearch(): void
113116 * @runInSeparateProcess
114117 * @preserveGlobalState disabled
115118 */
116- public function autocompleteSearchTest (): void
119+ public function testAutocompleteSearch (): void
117120 {
118121 // start-auto-query
119- $ movies = Movie::autocomplete ('title ' , 'jak ' )->get ();
122+ $ movies = Movie::autocomplete ('title ' , 'jak ' )->all ();
120123 // end-auto-query
121124
122125 $ this ->assertNotNull ($ movies );
@@ -127,7 +130,7 @@ public function autocompleteSearchTest(): void
127130 * @runInSeparateProcess
128131 * @preserveGlobalState disabled
129132 */
130- public function vectorSearchTest (): void
133+ public function testVectorSearch (): void
131134 {
132135 $ results = Book::vectorSearch (
133136 index: 'vector ' ,
0 commit comments