@@ -48,12 +48,12 @@ public function test_search_sends_correct_parameters_to_meilisearch()
4848 $ client = m::mock (Client::class);
4949 $ client ->shouldReceive ('index ' )->with ('table ' )->andReturn ($ index = m::mock (Indexes::class));
5050 $ index ->shouldReceive ('search ' )->with ('mustang ' , [
51- 'filters ' => 'foo=1 AND bar=2 ' ,
51+ 'filter ' => 'foo=1 AND bar=2 ' ,
5252 ]);
5353
5454 $ engine = new MeiliSearchEngine ($ client );
5555 $ builder = new Builder (new SearchableModel (), 'mustang ' , function ($ meilisearch , $ query , $ options ) {
56- $ options ['filters ' ] = 'foo=1 AND bar=2 ' ;
56+ $ options ['filter ' ] = 'foo=1 AND bar=2 ' ;
5757
5858 return $ meilisearch ->search ($ query , $ options );
5959 });
@@ -66,14 +66,14 @@ public function test_submitting_a_callable_search_with_search_method_returns_arr
6666 new SearchableModel (),
6767 $ query = 'mustang ' ,
6868 $ callable = function ($ meilisearch , $ query , $ options ) {
69- $ options ['filters ' ] = 'foo=1 ' ;
69+ $ options ['filter ' ] = 'foo=1 ' ;
7070
7171 return $ meilisearch ->search ($ query , $ options );
7272 }
7373 );
7474 $ client = m::mock (Client::class);
7575 $ client ->shouldReceive ('index ' )->with ('table ' )->andReturn ($ index = m::mock (Indexes::class));
76- $ index ->shouldReceive ('search ' )->with ($ query , ['filters ' => 'foo=1 ' ])->andReturn (new SearchResult ($ expectedResult = [
76+ $ index ->shouldReceive ('search ' )->with ($ query , ['filter ' => 'foo=1 ' ])->andReturn (new SearchResult ($ expectedResult = [
7777 'hits ' => [],
7878 'offset ' => 0 ,
7979 'limit ' => 20 ,
@@ -95,14 +95,14 @@ public function test_submitting_a_callable_search_with_raw_search_method_works()
9595 new SearchableModel (),
9696 $ query = 'mustang ' ,
9797 $ callable = function ($ meilisearch , $ query , $ options ) {
98- $ options ['filters ' ] = 'foo=1 ' ;
98+ $ options ['filter ' ] = 'foo=1 ' ;
9999
100100 return $ meilisearch ->rawSearch ($ query , $ options );
101101 }
102102 );
103103 $ client = m::mock (Client::class);
104104 $ client ->shouldReceive ('index ' )->with ('table ' )->andReturn ($ index = m::mock (Indexes::class));
105- $ index ->shouldReceive ('rawSearch ' )->with ($ query , ['filters ' => 'foo=1 ' ])->andReturn ($ expectedResult = [
105+ $ index ->shouldReceive ('rawSearch ' )->with ($ query , ['filter ' => 'foo=1 ' ])->andReturn ($ expectedResult = [
106106 'hits ' => [],
107107 'offset ' => 0 ,
108108 'limit ' => 20 ,
@@ -274,14 +274,14 @@ public function test_pagination_correct_parameters()
274274 $ client = m::mock (Client::class);
275275 $ client ->shouldReceive ('index ' )->with ('table ' )->andReturn ($ index = m::mock (Indexes::class));
276276 $ index ->shouldReceive ('search ' )->with ('mustang ' , [
277- 'filters ' => 'foo=1 ' ,
277+ 'filter ' => 'foo=1 ' ,
278278 'limit ' => $ perPage ,
279279 'offset ' => ($ page - 1 ) * $ perPage ,
280280 ]);
281281
282282 $ engine = new MeiliSearchEngine ($ client );
283283 $ builder = new Builder (new SearchableModel (), 'mustang ' , function ($ meilisearch , $ query , $ options ) {
284- $ options ['filters ' ] = 'foo=1 ' ;
284+ $ options ['filter ' ] = 'foo=1 ' ;
285285
286286 return $ meilisearch ->search ($ query , $ options );
287287 });
@@ -335,7 +335,7 @@ public function test_where_conditions_are_applied()
335335 $ client = m::mock (Client::class);
336336 $ client ->shouldReceive ('index ' )->once ()->andReturn ($ index = m::mock (Indexes::class));
337337 $ index ->shouldReceive ('rawSearch ' )->once ()->with ($ builder ->query , array_filter ([
338- 'filters ' => 'foo="bar" AND key="value" ' ,
338+ 'filter ' => 'foo="bar" AND key="value" ' ,
339339 'limit ' => $ builder ->limit ,
340340 ]))->andReturn ([]);
341341
@@ -353,7 +353,7 @@ public function test_where_in_conditions_are_applied()
353353 $ client = m::mock (Client::class);
354354 $ client ->shouldReceive ('index ' )->once ()->andReturn ($ index = m::mock (Indexes::class));
355355 $ index ->shouldReceive ('rawSearch ' )->once ()->with ($ builder ->query , array_filter ([
356- 'filters ' => 'foo="bar" AND bar="baz" AND (qux=1 OR qux=2) AND (quux=1 OR quux=2) ' ,
356+ 'filter ' => 'foo="bar" AND bar="baz" AND (qux=1 OR qux=2) AND (quux=1 OR quux=2) ' ,
357357 'limit ' => $ builder ->limit ,
358358 ]))->andReturn ([]);
359359
@@ -369,7 +369,7 @@ public function test_where_in_conditions_are_applied_without_other_conditions()
369369 $ client = m::mock (Client::class);
370370 $ client ->shouldReceive ('index ' )->once ()->andReturn ($ index = m::mock (Indexes::class));
371371 $ index ->shouldReceive ('rawSearch ' )->once ()->with ($ builder ->query , array_filter ([
372- 'filters ' => '(qux=1 OR qux=2) AND (quux=1 OR quux=2) ' ,
372+ 'filter ' => '(qux=1 OR qux=2) AND (quux=1 OR quux=2) ' ,
373373 'limit ' => $ builder ->limit ,
374374 ]))->andReturn ([]);
375375
0 commit comments