$response =
$this->
getBrowser()->
getResponse()->
getContent();
$response =
json_decode($response ?: '', true, 512, \JSON_THROW_ON_ERROR
);
static::
assertArrayHasKey('errors',
$response);
static::
assertEquals('FRAMEWORK__API_SALES_CHANNEL_ID_PARAMETER_IS_MISSING',
$response['errors'
][0
]['code'
] ?? null
);
} public function testModifyShippingCostsWithoutShippingCosts(): void
{ $salesChannel =
$this->
createSalesChannel();
$browser =
$this->
getBrowser();
$browser->
setServerParameter('HTTP_SW_CONTEXT_TOKEN', Uuid::
randomHex());
$browser->
request('PATCH',
$this->
getRootProxyUrl('/modify-shipping-costs'
),
[ 'shippingCosts' =>
[],
'salesChannelId' =>
$salesChannel['id'
],
]);
$response =
$browser->
getResponse()->
getContent();
$response =
json_decode($response ?: '', true, 512, \JSON_THROW_ON_ERROR
);
static::
assertArrayHasKey('errors',
$response);
static::
assertCount(2,
$response['errors'
]);
static::
assertSame('/unitPrice',
$response['errors'
][0
]['source'
]['pointer'
]);