$result =
json_decode($response->
getContent(), true, 512, \JSON_THROW_ON_ERROR
);
static::
assertNotEmpty($result['errors'
] ??
[]);
static::
assertEquals(400,
$response->
getStatusCode());
} public function testValidateValid(): void
{ $salesChannelId = Uuid::
randomHex();
$this->
createStorefrontSalesChannelContext($salesChannelId, 'test'
);
$this->
createTestProduct($salesChannelId);
$template =
new SeoUrlTemplateEntity();
$template->
setRouteName('frontend.detail.page'
);
$template->
setTemplate('{{ product.name }}'
);
$template->
setEntityName(ProductDefinition::ENTITY_NAME
);
$template->
setSalesChannelId($salesChannelId);
$this->
getBrowser()->
request('POST', '/api/_action/seo-url-template/validate',
$template->
jsonSerialize());
$response =
$this->
getBrowser()->
getResponse();
$result =
json_decode($response->
getContent(), true, 512, \JSON_THROW_ON_ERROR
);
static::
assertArrayNotHasKey('errors',
$result);