Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
setUpTerms example
protected
$defaultTheme
= 'stark';
/** * {@inheritdoc} */
protected
function
setUp
(
)
: void
{
parent::
setUp
(
)
;
$this
->
setupLanguages
(
)
;
$this
->vocabulary =
$this
->
createVocabulary
(
)
;
$this
->
enableTranslation
(
)
;
$this
->
setUpTerms
(
)
;
$this
->
setUpTermReferenceField
(
)
;
}
/** * Tests translated breadcrumbs. */
public
function
testTranslatedBreadcrumbs
(
)
{
// Ensure non-translated breadcrumb is correct.
$breadcrumb
=
[
Url::
fromRoute
(
'<front>'
)
->
toString
(
)
=> 'Home'
]
;
foreach
(
$this
->terms
as
$term
)
{
$breadcrumb
[
$term
->
toUrl
(
)
->
toString
(
)
]
=
$term
->
label
(
)
;
}