$entity_type_manager =
$this->
createMock(EntityTypeManagerInterface::
class);
$config_factory =
$this->
getConfigFactoryStub([]);
$forum_manager =
$this->
createMock('Drupal\forum\ForumManagerInterface'
);
$forum_manager->
expects($this->
any()) ->
method('checkNodeType'
) ->
willReturn(TRUE
);
$translation_manager =
$this->
createMock('Drupal\Core\StringTranslation\TranslationInterface'
);
// Make an object to test.
$builder =
new ForumNodeBreadcrumbBuilder($entity_type_manager,
$config_factory,
$forum_manager,
$translation_manager);
$route_match =
$this->
createMock('Drupal\Core\Routing\RouteMatchInterface'
);
$route_match->
expects($this->
once()) ->
method('getRouteName'
) ->
willReturn($route_name);
$route_match->
expects($this->
any()) ->
method('getParameter'
) ->
willReturnMap($parameter_map);
$this->
assertEquals($expected,
$builder->
applies($route_match));
}