$first =
$this->productRepository->
search($this->
getCriteria($id,
$salesChannelId),
$salesChannelContext->
getContext())->
first();
static::
assertInstanceOf(SeoUrlCollection::
class,
$first->
getSeoUrls());
/** @var SeoUrlCollection $seoUrls */
$seoUrls =
$first->
getSeoUrls();
/** @var SeoUrlEntity $seoUrl */
$seoUrl =
$seoUrls->
first();
static::
assertSame($first->
getId(),
$seoUrl->
getForeignKey());
static::
assertSame(ProductPageSeoUrlRoute::ROUTE_NAME,
$seoUrl->
getRouteName());
static::
assertSame('/detail/' .
$id,
$seoUrl->
getPathInfo());
static::
assertSame('foo/awesome-product/bar',
$seoUrl->
getSeoPathInfo());
static::
assertTrue($seoUrl->
getIsCanonical());
} public function testCustomUpdateSamePath(): void
{ $salesChannelId = Uuid::
randomHex();
$salesChannelContext =
$this->
createStorefrontSalesChannelContext($salesChannelId, 'test'
);
$id = Uuid::
randomHex();
$this->
upsertTemplate([ 'id' =>
$id,
'salesChannelId' =>
$salesChannelId,