Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
setLinkType example
$category
=
new
CategoryEntity
(
)
;
$category
->
setType
(
CategoryDefinition::TYPE_FOLDER
)
;
static
::
assertNull
(
$this
->urlGenerator->
generate
(
$category
,
$this
->salesChannel
)
)
;
}
public
function
testLinkCategoryHome
(
)
: void
{
$category
=
new
CategoryEntity
(
)
;
$category
->
setType
(
CategoryDefinition::TYPE_LINK
)
;
$category
->
setLinkType
(
CategoryDefinition::LINK_TYPE_CATEGORY
)
;
$category
->
addTranslated
(
'linkType', CategoryDefinition::LINK_TYPE_CATEGORY
)
;
$category
->
setInternalLink
(
Uuid::
randomHex
(
)
)
;
$category
->
addTranslated
(
'internalLink',
$category
->
getInternalLink
(
)
)
;
$this
->salesChannel->
setNavigationCategoryId
(
$category
->
getInternalLink
(
)
)
;
static
::
assertSame
(
'frontend.home.page',
$this
->urlGenerator->
generate
(
$category
,
$this
->salesChannel
)
)
;
}
/** * @dataProvider dataProviderLinkTypes */