private EntityRepository
$currencyRepository;
protected function setUp(): void
{ $this->currencyRepository =
$this->
getContainer()->
get(CurrencyDefinition::ENTITY_NAME . '.repository'
);
} public function testSerializePrice(): void
{ $priceField =
new PriceField('price', 'price'
);
$priceSerializer =
new PriceSerializer($this->currencyRepository
);
$config =
new Config([],
[],
[]);
$price =
new Price(Defaults::CURRENCY, 10.0, 10.0, false
);
$expectedSerialized =
[ 'EUR' =>
[ 'currencyId' => Defaults::CURRENCY,
'extensions' =>
[],
'gross' => 10.0,
'linked' => false,
'listPrice' => null,