'foreignKey' =>
$fk,
'pathInfo' => 'normal/path',
'seoPathInfo' => 'fancy-path-2',
],
];
$this->seoUrlPersister->
updateSeoUrls($context, 'foo.route',
array_column($seoUrlUpdates, 'foreignKey'
),
$seoUrlUpdates,
$this->salesChannel
);
$seoUrls =
$this->seoUrlRepository->
search(new Criteria(), Context::
createDefaultContext())->
getEntities();
static::
assertCount(2,
$seoUrls);
$canonicalUrls =
$seoUrls->
filterByProperty('isCanonical', true
);
static::
assertCount(1,
$canonicalUrls);
/** @var SeoUrlEntity $first */
$first =
$canonicalUrls->
first();
static::
assertSame('fancy-path-2',
$first->
getSeoPathInfo());
$obsoletedSeoUrls =
$seoUrls->
filterByProperty('isCanonical', null
);
static::
assertCount(1,
$obsoletedSeoUrls);
/** @var SeoUrlEntity $first */
$first =
$obsoletedSeoUrls->
first();
static::
assertSame('fancy-path',
$first->
getSeoPathInfo());
}