'sum' =>
new SumResult('sum', 2.3
),
]);
$productListingResultMock =
$this->
createMock(ProductListingResult::
class);
$productListingResultMock->
method('getAggregations'
)->
willReturn( new AggregationResultCollection( $testAggregations ) );
$request =
new Request();
$productListingRouteResponse =
new ProductListingRouteResponse($productListingResultMock);
$this->productListingRouteMock->
method('load'
)->
willReturn($productListingRouteResponse);
$response =
$this->controller->
filter($ids->
get('navigation'
),
$request,
$this->
createMock(SalesChannelContext::
class));
static::
assertEquals( json_encode($testAggregations, \JSON_THROW_ON_ERROR
),
json_encode(json_decode($response->
getContent() ?: '', true, 512, \JSON_THROW_ON_ERROR
), \JSON_THROW_ON_ERROR
) );
static::
assertTrue($request->request->
get('only-aggregations'
));
static::
assertTrue($request->request->
get('reduce-aggregations'
));
}