class GrossPriceCalculatorTest extends TestCase
{ /**
* @dataProvider referencePriceCalculationProvider
*/
public function testReferencePriceCalculation(?ReferencePriceDefinition
$reference, float
$price, ?ReferencePrice
$expected): void
{ $definition =
new QuantityPriceDefinition($price,
new TaxRuleCollection(), 1
);
$definition->
setReferencePriceDefinition($reference);
$calculator =
new GrossPriceCalculator(new TaxCalculator(),
new CashRounding());
$result =
$calculator->
calculate($definition,
new CashRoundingConfig(2, 0.01, true
));
static::
assertEquals($expected,
$result->
getReferencePrice());
} public static function referencePriceCalculationProvider(): \Generator
{ yield 'test calculation without reference price' =>
[ null,