yield 'Gross price will be used for gross state' =>
[$product, CartPrice::TAX_STATE_GROSS, 20
];
yield 'Net price will be used for net price state' =>
[$product, CartPrice::TAX_STATE_NET, 10
];
yield 'Net price will be used for tax free state' =>
[$product, CartPrice::TAX_STATE_FREE, 10
];
} public function testEnsureUnitCaching(): void
{ $reflection =
new \
ReflectionClass($this->calculator
);
$property =
$reflection->
getProperty('units'
);
$property->
setAccessible(true
);
static::
assertNull($property->
getValue($this->calculator
));
$this->calculator->
calculate([],
$this->
createMock(SalesChannelContext::
class));
static::
assertNotNull($property->
getValue($this->calculator
));
// repository mock assertion to ensure only one load
$this->calculator->
calculate([],
$this->
createMock(SalesChannelContext::
class));
// good moment to test reset interface here