'price' =>
[['currencyId' => Defaults::CURRENCY, 'gross' => 10, 'net' => 8.10, 'linked' => false
]],
'tax' =>
['name' => 'test', 'taxRate' => 5
],
'manufacturer' =>
[ 'id' => Uuid::
randomHex(),
'name' => 'shopware AG',
'link' => 'https://shopware.com',
],
'toOne' =>
[ 'name' => 'test',
],
],
], Context::
createDefaultContext());
$criteria =
new Criteria([$productId]);
$criteria->
addAssociation('toOne'
);
$productDefinition =
$this->
getContainer()->
get(ProductDefinition::
class);
/** @var ProductEntity $product */
$product =
$this->productRepository->
search($criteria, Context::
createDefaultContext())->
get($productId);
$encoder =
$this->
getContainer()->
get(JsonApiEncoder::
class);
$encodedResponse =
$encoder->
encode(new Criteria(),
$productDefinition,
$product, SerializationFixture::API_BASE_URL
);
$actual =
json_decode((string) $encodedResponse, true, 512, \JSON_THROW_ON_ERROR
);