public function testRegulationPriceCalculation( ?float
$reference,
?RegulationPrice
$expected ): void
{ $definition =
new QuantityPriceDefinition(100,
new TaxRuleCollection(), 1
);
$definition->
setRegulationPrice($reference);
$calculator =
new NetPriceCalculator(new TaxCalculator(),
new CashRounding());
$price =
$calculator->
calculate($definition,
new CashRoundingConfig(2, 0.01, true
));
static::
assertEquals($expected,
$price->
getRegulationPrice());
} public static function regulationPriceCalculationProvider(): \Generator
{ yield 'test calculation without reference price' =>
[ null,
null,
];
yield 'test calculation with reference price' =>
[ 100,