'price' =>
[['currencyId' => Defaults::CURRENCY, 'gross' => 50, 'net' => 25, 'linked' => false
]],
];
$browser->
request('POST', '/api/product',
[],
[],
[],
json_encode($data, \JSON_THROW_ON_ERROR
));
$browser->
request('POST', '/api/_action/version/' . Defaults::LIVE_VERSION . '/product/' .
$id);
$repo =
$this->
getContainer()->
get(ProductDefinition::ENTITY_NAME . '.repository'
);
$criteria =
new Criteria([$id]);
$criteria->
addFilter(new EqualsFilter('versionId', Defaults::LIVE_VERSION
));
static::
assertNotNull($repo->
search($criteria, Context::
createDefaultContext())->
getEntities()->
first());
$response =
$browser->
getResponse();
static::
assertSame(Response::HTTP_INTERNAL_SERVER_ERROR,
$response->
getStatusCode(),
(string) $response->
getContent());
$content =
json_decode((string) $response->
getContent(), true, 512, \JSON_THROW_ON_ERROR
);
static::
assertSame(ApiException::
deleteLiveVersion()->
getErrorCode(),
$content['errors'
][0
]['code'
]);
} public function testDeleteWithoutPermission(): void
{