$browser->
request('POST', '/api/search/product',
[]);
$response =
$browser->
getResponse();
static::
assertSame(Response::HTTP_UNAUTHORIZED,
$response->
getStatusCode(),
(string) $response->
getContent());
$jsonResponse =
json_decode((string) $response->
getContent(), true, 512, \JSON_THROW_ON_ERROR
);
static::
assertEquals('Access token is expired',
$jsonResponse['errors'
][0
]['detail'
]);
} public function testPreventCreationOfSalesChannelWithoutDefaultSalesChannelLanguage(): void
{ $salesChannelId = Uuid::
randomHex();
$data =
$this->
getSalesChannelData($salesChannelId,
$this->
getNonSystemLanguageId());
$browser =
$this->
getBrowser();
$browser->
request('POST', '/api/sales-channel/',
$data,
[],
[],
json_encode($data, \JSON_THROW_ON_ERROR
));
$response =
$browser->
getResponse();
static::
assertSame(400,
$response->
getStatusCode());
$content =
json_decode((string) $response->
getContent(), true, 512, \JSON_THROW_ON_ERROR
);
$error =
$content['errors'
][0
];
static::
assertSame(sprintf(self::INSERT_VALIDATION_MESSAGE,
$salesChannelId),
$error['detail'
]);
}