private MockObject&SeoUrlPlaceholderHandlerInterface
$replacer;
private SalesChannelEntity
$salesChannel;
protected function setUp(): void
{ $this->replacer =
$this->
getMockBuilder(SeoUrlPlaceholderHandlerInterface::
class)->
getMock();
$this->urlGenerator =
new CategoryUrlGenerator($this->replacer
);
$this->replacer->
method('generate'
)->
willReturnArgument(0
);
$this->salesChannel =
new SalesChannelEntity();
$this->salesChannel->
setNavigationCategoryId(Uuid::
randomHex());
} public function testPage(): void
{ $category =
new CategoryEntity();
$category->
setId(Uuid::
randomHex());
$category->
setType(CategoryDefinition::TYPE_PAGE
);
static::
assertSame('frontend.navigation.page',
$this->urlGenerator->
generate($category,
$this->salesChannel
));
}