File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -63,6 +63,30 @@ public function test_it_can_paginate_with_custom_query_callback()
6363 $ this ->assertSame (15 , $ paginator ->perPage ());
6464 }
6565
66+ public function test_it_can_paginate_raw_without_custom_query_callback ()
67+ {
68+ $ this ->prepareScoutSearchMockUsing ('Laravel ' );
69+
70+ $ paginator = SearchableUserModel::search ('Laravel ' )->paginateRaw ();
71+
72+ $ this ->assertSame (50 , $ paginator ->total ());
73+ $ this ->assertSame (4 , $ paginator ->lastPage ());
74+ $ this ->assertSame (15 , $ paginator ->perPage ());
75+ }
76+
77+ public function test_it_can_paginate_raw_with_custom_query_callback ()
78+ {
79+ $ this ->prepareScoutSearchMockUsing ('Laravel ' );
80+
81+ $ paginator = SearchableUserModel::search ('Laravel ' )->query (function ($ builder ) {
82+ return $ builder ->where ('id ' , '< ' , 11 );
83+ })->paginateRaw ();
84+
85+ $ this ->assertSame (10 , $ paginator ->total ());
86+ $ this ->assertSame (1 , $ paginator ->lastPage ());
87+ $ this ->assertSame (15 , $ paginator ->perPage ());
88+ }
89+
6690 protected function prepareScoutSearchMockUsing ($ searchQuery )
6791 {
6892 $ engine = m::mock ('MeiliSearch\Client ' );
You can’t perform that action at this time.
0 commit comments