@@ -154,6 +154,57 @@ class MultiMatch extends \Tester\TestCase
154154 }
155155
156156
157+ public function testMinimumShouldMatchString (): void
158+ {
159+ $ multiMatch = new \Spameri \ElasticQuery \Query \MultiMatch (
160+ ['title ' , 'description ' ],
161+ 'search term ' ,
162+ 1.0 ,
163+ null ,
164+ \Spameri \ElasticQuery \Query \Match \MultiMatchType::BEST_FIELDS ,
165+ '75% ' ,
166+ );
167+
168+ $ array = $ multiMatch ->toArray ();
169+
170+ \Tester \Assert::same ('75% ' , $ array ['multi_match ' ]['minimum_should_match ' ]);
171+ }
172+
173+
174+ public function testMinimumShouldMatchCombinationString (): void
175+ {
176+ $ multiMatch = new \Spameri \ElasticQuery \Query \MultiMatch (
177+ ['title ' , 'description ' ],
178+ 'search term query ' ,
179+ 1.0 ,
180+ null ,
181+ \Spameri \ElasticQuery \Query \Match \MultiMatchType::BEST_FIELDS ,
182+ '2<90% ' ,
183+ );
184+
185+ $ array = $ multiMatch ->toArray ();
186+
187+ \Tester \Assert::same ('2<90% ' , $ array ['multi_match ' ]['minimum_should_match ' ]);
188+ }
189+
190+
191+ public function testMinimumShouldMatchInt (): void
192+ {
193+ $ multiMatch = new \Spameri \ElasticQuery \Query \MultiMatch (
194+ ['title ' , 'description ' ],
195+ 'search term ' ,
196+ 1.0 ,
197+ null ,
198+ \Spameri \ElasticQuery \Query \Match \MultiMatchType::BEST_FIELDS ,
199+ 2 ,
200+ );
201+
202+ $ array = $ multiMatch ->toArray ();
203+
204+ \Tester \Assert::same (2 , $ array ['multi_match ' ]['minimum_should_match ' ]);
205+ }
206+
207+
157208 public function testCreate (): void
158209 {
159210 $ multiMatch = new \Spameri \ElasticQuery \Query \MultiMatch (
0 commit comments