$stubs =
new ScriptPriceStubs( // not necessary for this test
$this->
createMock(Connection::
class),
$quantityCalculator,
new PercentagePriceCalculator(new CashRounding(),
$quantityCalculator,
new PercentageTaxRuleBuilder()),
);
$entity->
assign(['calculatedPrice' =>
new CalculatedPrice(10, 10,
new CalculatedTaxCollection(),
new TaxRuleCollection())]);
$original =
new CalculatedCheapestPrice(10, 10,
new CalculatedTaxCollection(),
new TaxRuleCollection(new TaxRuleCollection([new TaxRule(10
)])));
// mock context to simulate currency and tax states
$context =
$this->
createMock(SalesChannelContext::
class);
// currency key will be provided, we want to test different currencies are taking into account
$context->
expects(static::
any())->
method('getCurrencyId'
)->
willReturn($ids->
get($currencyKey));
// we also want to test different tax states (gross/net)
$context->
expects(static::
any())->
method('getTaxState'
)->
willReturn($taxState);
$context->
expects(static::
any())->
method('getItemRounding'
)->
willReturn(new CashRoundingConfig(2, 0.01, true
));