Skip to content

Commit

Permalink
Merge pull request #3614 from magento-tango/MAGETWO-97495
Browse files Browse the repository at this point in the history
[TANGO] PR
  • Loading branch information
dhorytskyi authored Jan 21, 2019
2 parents d1ebc17 + a3f2cde commit 2f30dde
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ public function getAggregation(
'histogram' => [
'field' => $fieldName,
'interval' => (float)$range,
'min_doc_count' => 1,
],
],
];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -321,8 +321,15 @@ public function testGetAggregation()
$this->clientMock->expects($this->once())
->method('query')
->with($this->callback(function ($query) {
$histogramParams = $query['body']['aggregations']['prices']['histogram'];
// Assert the interval is queried as a float. See MAGETWO-95471
return $query['body']['aggregations']['prices']['histogram']['interval'] === 10.0;
if ($histogramParams['interval'] !== 10.0) {
return false;
}
if (!isset($histogramParams['min_doc_count']) || $histogramParams['min_doc_count'] !== 1) {
return false;
}
return true;
}))
->willReturn([
'aggregations' => [
Expand Down

0 comments on commit 2f30dde

Please sign in to comment.