'id' =>
$id,
'productNumber' => Uuid::
randomHex(),
'stock' => 1,
'name' =>
$id,
'tax' =>
['name' => 'test', 'taxRate' => 10
],
'manufacturer' =>
['name' => 'test'
],
'price' =>
[ ['currencyId' => Defaults::CURRENCY, 'gross' => 50, 'net' => 25, 'linked' => false
],
],
];
$this->
getBrowserAuthenticatedWithIntegration()->
request('POST', '/api/product',
[],
[],
[],
json_encode($data, \JSON_THROW_ON_ERROR
));
$response =
$this->
getBrowserAuthenticatedWithIntegration()->
getResponse();
static::
assertSame(Response::HTTP_NO_CONTENT,
$response->
getStatusCode(),
(string) $response->
getContent());
static::
assertNotEmpty($response->headers->
get('Location'
));
static::
assertEquals('http://localhost/api/product/' .
$id,
$response->headers->
get('Location'
));
$this->
getBrowserAuthenticatedWithIntegration()->
request('GET', '/api/product/' .
$id);
static::
assertSame(Response::HTTP_OK,
$this->
getBrowserAuthenticatedWithIntegration()->
getResponse()->
getStatusCode(),
(string) $this->
getBrowserAuthenticatedWithIntegration()->
getResponse()->
getContent());
}