$categories =
[ ['id' =>
$ids->
create('root'
), 'name' => 'root', 'active' => true
],
['id' =>
$ids->
create('a'
), 'name' => 'a', 'parentId' =>
$ids->
get('root'
), 'active' => true
],
['id' =>
$ids->
create('b'
), 'name' => 'b', 'parentId' =>
$ids->
get('a'
), 'active' => true
],
];
$this->categoryRepository->
create($categories, Context::
createDefaultContext());
$this->
createSalesChannel($ids->
create('sales-channel'
),
$ids->
get('root'
));
// sales channel navigation id switch detected, seo urls are generated by message queue
$this->
runWorker();
$urls =
$this->
getSeoUrls($ids->
getList(['root', 'a', 'b'
]),
$ids->
get('sales-channel'
));
static::
assertCount(2,
$urls);
static::
assertArrayHasKey('a/',
$urls);
static::
assertArrayHasKey('a/b/',
$urls);
$this->salesChannelRepository->
update([ ['id' =>
$ids->
get('sales-channel'
), 'navigationCategoryId' =>
$ids->
get('a'
)],
], Context::
createDefaultContext());