Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
ProductPriceCalculator example
/** * @internal * * @covers \Shopware\Core\Content\Product\SalesChannel\Price\ProductPriceCalculator */
class
ProductPriceCalculatorTest
extends
TestCase
{
private
ProductPriceCalculator
$calculator
;
protected
function
setUp
(
)
: void
{
$this
->calculator =
new
ProductPriceCalculator
(
new
StaticEntityRepository
(
[
new
UnitCollection
(
[
(
new
UnitEntity
(
)
)
->
assign
(
[
'id' => Defaults::CURRENCY, 'translated' =>
[
'name' => 'test'
]
]
)
]
)
,
]
)
,
new
QuantityPriceCalculator
(
new
GrossPriceCalculator
(
new
TaxCalculator
(
)
,
new
CashRounding
(
)
)
,
new
NetPriceCalculator
(
new
TaxCalculator
(
)
,
new
CashRounding
(
)
)
)
)
;
}