File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -627,4 +627,31 @@ public function it_supports_full_text_search()
627627 $ this ->assertTrue ($ results ->contains ($ blogA ));
628628 $ this ->assertTrue ($ results ->contains ($ pageA ));
629629 }
630+
631+ /** @test */
632+ public function it_returns_data_consistently () {
633+ Carbon::setTestNow (now ());
634+ $ postA = Post::create (['title ' => 'Laravel Framework ' ]);
635+
636+ Carbon::setTestNow (now ()->addSecond ());
637+ $ postB = Post::create (['title ' => 'Tailwind Framework ' ]);
638+
639+ $ this ->assertEquals (2 , Post::all ()->count ());
640+ $ this ->assertEquals (0 , Blog::all ()->count ());
641+
642+ $ resultA = Search::addMany ([
643+ [Post::query (), 'title ' ],
644+ ])->get ('' );
645+
646+ $ resultB = Search::addMany ([
647+ [Post::query (), 'title ' ],
648+ [Blog::query (), 'title ' ],
649+ ])->get ('' );
650+
651+ $ this ->assertCount (2 , $ resultA );
652+ $ this ->assertCount (2 , $ resultB );
653+
654+ $ this ->assertTrue ($ resultA ->first ()->is ($ postA ));
655+ $ this ->assertTrue ($ resultB ->first ()->is ($ postA ));
656+ }
630657}
You can’t perform that action at this time.
0 commit comments