@@ -24,7 +24,7 @@ public function testFilter(BoolQueryBuilder $query, array $expected): void
2424 $ this ->assertArrayStructure (['bool ' => ['filter ' => [$ expected ]]], $ query ->toDSL ());
2525 }
2626
27- public function provideFilter (): array
27+ public static function provideFilter (): array
2828 {
2929 return [
3030 'term ' => [
@@ -53,7 +53,7 @@ public function testMustNot(BoolQueryBuilder $query, array $expected): void
5353 $ this ->assertArrayStructure (['bool ' => ['must_not ' => [$ expected ]]], $ query ->toDSL ());
5454 }
5555
56- public function provideMustNot (): array
56+ public static function provideMustNot (): array
5757 {
5858 return [
5959 'term ' => [BoolQueryBuilder::make ()->whereNot ('name ' , 'Product ' ), ['term ' ]],
@@ -76,7 +76,7 @@ public function testEmptyMatchAll(BoolQueryBuilder $query): void
7676 $ this ->assertArrayFragment (['match_all ' => new stdClass ()], $ query ->toDSL ());
7777 }
7878
79- public function provideEmpty (): array
79+ public static function provideEmpty (): array
8080 {
8181 return [
8282 'empty ' => [BoolQueryBuilder::make ()],
@@ -122,7 +122,7 @@ public function testWhereOperators(string $operator, array $expected): void
122122 $ this ->assertArrayFragment ($ expected , $ dsl );
123123 }
124124
125- public function provideWhereOperators (): array
125+ public static function provideWhereOperators (): array
126126 {
127127 return [
128128 '= ' => ['= ' , ['term ' => ['rating ' => 5 ]]],
@@ -144,7 +144,7 @@ public function testMatch(string|MatchOptions $options, array $expected): void
144144 $ this ->assertArrayFragment (['must ' => [["match " => ['name ' => array_merge (['query ' => 'foo ' ], $ expected )]]]], $ dsl );
145145 }
146146
147- public function provideMatch (): array
147+ public static function provideMatch (): array
148148 {
149149 return [
150150 'operator ' => ['and ' , ['operator ' => 'and ' ]],
@@ -170,7 +170,7 @@ public function testOrMatch(string|MatchOptions $options, array $expected): void
170170 $ this ->assertArrayFragment (['should ' => [["match " => ['name ' => array_merge (['query ' => 'foo ' ], $ expected )]]]], $ dsl );
171171 }
172172
173- public function provideOrMatch (): array
173+ public static function provideOrMatch (): array
174174 {
175175 return [
176176 'operator ' => ['and ' , ['operator ' => 'and ' ]],
@@ -196,7 +196,30 @@ public function testMultiMatch(string|MultiMatchOptions|null $options, array $ex
196196 $ this ->assertArrayFragment (array_merge (['query ' => 'baz ' , 'fields ' => ['foo ' , 'bar ' ]], $ expected ), $ dsl );
197197 }
198198
199- public function provideMultiMatch (): array
199+ public static function provideMultiMatch (): array
200+ {
201+ return [
202+ 'type as string ' => [MatchType::CROSS_FIELDS , ['type ' => MatchType::CROSS_FIELDS ]],
203+ 'type in options ' => [MultiMatchOptions::make (MatchType::PHRASE ), ['type ' => MatchType::PHRASE ]],
204+ 'fuzziness ' => [MultiMatchOptions::make (fuzziness: 'AUTO ' ), ['fuzziness ' => 'AUTO ' ]],
205+ 'multiple options ' => [
206+ MultiMatchOptions::make (type: MatchType::MOST_FIELDS , fuzziness: '3 ' , minimumShouldMatch: '30% ' ),
207+ ['minimum_should_match ' => '30% ' , 'fuzziness ' => '3 ' , 'type ' => MatchType::MOST_FIELDS ],
208+ ],
209+ ];
210+ }
211+
212+ /**
213+ * @dataProvider provideOrMultiMatch
214+ */
215+ public function testOrMultiMatch (string |MultiMatchOptions |null $ options , array $ expected ): void
216+ {
217+ $ dsl = BoolQueryBuilder::make ()->OrWhereMultiMatch (['foo ' , 'bar ' ], 'baz ' , $ options )->toDSL ();
218+
219+ $ this ->assertArrayFragment (array_merge (['query ' => 'baz ' , 'fields ' => ['foo ' , 'bar ' ]], $ expected ), $ dsl );
220+ }
221+
222+ public static function provideOrMultiMatch (): array
200223 {
201224 return [
202225 'type as string ' => [MatchType::CROSS_FIELDS , ['type ' => MatchType::CROSS_FIELDS ]],
@@ -219,7 +242,7 @@ public function testWildcard(?WildcardOptions $options, array $expected): void
219242 $ this ->assertArrayFragment (['must ' => [['wildcard ' => ['foo ' => array_merge (['value ' => '%value% ' ], $ expected )]]]], $ dsl );
220243 }
221244
222- public function provideWildcard (): array
245+ public static function provideWildcard (): array
223246 {
224247 return [
225248 'empty options ' => [WildcardOptions::make (0 , false ), ['boost ' => 0 , 'case_insensitive ' => false ]],
@@ -238,7 +261,7 @@ public function testOrWildcard(?WildcardOptions $options, array $expected): void
238261 $ this ->assertArrayFragment (['should ' => [['wildcard ' => ['foo ' => array_merge (['value ' => '%value% ' ], $ expected )]]]], $ dsl );
239262 }
240263
241- public function provideOrWildcard (): array
264+ public static function provideOrWildcard (): array
242265 {
243266 return [
244267 'empty options ' => [WildcardOptions::make (0 , false ), ['boost ' => 0 , 'case_insensitive ' => false ]],
0 commit comments