->
method('getParameter'
) ->
with('taxonomy_term'
) ->
willReturn($forum_listing);
// First test.
$expected1 =
[ Link::
createFromRoute('Home', '<front>'
),
Link::
createFromRoute('Fora_is_the_plural_of_forum', 'forum.index'
),
Link::
createFromRoute('Something', 'forum.page',
['taxonomy_term' => 1
]),
];
$breadcrumb =
$breadcrumb_builder->
build($route_match);
$this->
assertEquals($expected1,
$breadcrumb->
getLinks());
$this->
assertEqualsCanonicalizing(['route'
],
$breadcrumb->
getCacheContexts());
$this->
assertEqualsCanonicalizing(['taxonomy_term:1', 'taxonomy_term:23', 'taxonomy_vocabulary:5'
],
$breadcrumb->
getCacheTags());
$this->
assertEqualsCanonicalizing(Cache::PERMANENT,
$breadcrumb->
getCacheMaxAge());
// Second test.
$expected2 =
[ Link::
createFromRoute('Home', '<front>'
),
Link::
createFromRoute('Fora_is_the_plural_of_forum', 'forum.index'
),
Link::
createFromRoute('Something else', 'forum.page',
['taxonomy_term' => 2
]),
Link::
createFromRoute('Something', 'forum.page',
['taxonomy_term' => 1
]),
];