File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
app/code/Magento/Elasticsearch
Test/Unit/SearchAdapter/Dynamic Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -212,6 +212,7 @@ public function getAggregation(
212212 'histogram ' => [
213213 'field ' => $ fieldName ,
214214 'interval ' => (float )$ range ,
215+ 'min_doc_count ' => 1 ,
215216 ],
216217 ],
217218 ];
Original file line number Diff line number Diff line change @@ -321,8 +321,15 @@ public function testGetAggregation()
321321 $ this ->clientMock ->expects ($ this ->once ())
322322 ->method ('query ' )
323323 ->with ($ this ->callback (function ($ query ) {
324+ $ histogramParams = $ query ['body ' ]['aggregations ' ]['prices ' ]['histogram ' ];
324325 // Assert the interval is queried as a float. See MAGETWO-95471
325- return $ query ['body ' ]['aggregations ' ]['prices ' ]['histogram ' ]['interval ' ] === 10.0 ;
326+ if ($ histogramParams ['interval ' ] !== 10.0 ) {
327+ return false ;
328+ }
329+ if (!isset ($ histogramParams ['min_doc_count ' ]) || $ histogramParams ['min_doc_count ' ] !== 1 ) {
330+ return false ;
331+ }
332+ return true ;
326333 }))
327334 ->willReturn ([
328335 'aggregations ' => [
You can’t perform that action at this time.
0 commit comments