public function testCalculateAmountWithGrossPrices(CartPrice
$expected, PriceCollection
$prices): void
{ $salesChannelContext =
$this->
createMock(SalesChannelContext::
class);
$salesChannelContext->
method('getSalesChannel'
)->
willReturn(new SalesChannelEntity());
$salesChannelContext->
method('getContext'
)->
willReturn(Context::
createDefaultContext());
$salesChannelContext->
method('getTaxCalculationType'
)->
willReturn(SalesChannelDefinition::CALCULATION_TYPE_HORIZONTAL
);
$salesChannelContext->
method('getItemRounding'
)->
willReturn(new CashRoundingConfig(2, 0.01, true
));
$salesChannelContext->
method('getTotalRounding'
)->
willReturn(new CashRoundingConfig(2, 0.01, true
));
$salesChannelContext->
method('getTaxState'
)->
willReturn(CartPrice::TAX_STATE_GROSS
);
$calculator =
new AmountCalculator( new CashRounding(),
new PercentageTaxRuleBuilder(),
new TaxCalculator() );
$cartPrice =
$calculator->
calculate($prices,
new PriceCollection(),
$salesChannelContext);
static::
assertEquals($expected,
$cartPrice);
} /**
* @dataProvider calculateAmountWithNetPricesProvider
*/