/**
* Sets up the unrouted URL assembler and the link generator.
*/
protected function setUpUrlIntegrationServices() { $this->pathProcessor =
$this->
createMock('Drupal\Core\PathProcessor\OutboundPathProcessorInterface'
);
$this->unroutedUrlAssembler =
new UnroutedUrlAssembler($this->requestStack,
$this->pathProcessor
);
\Drupal::
getContainer()->
set('unrouted_url_assembler',
$this->unroutedUrlAssembler
);
$this->linkGenerator =
new LinkGenerator($this->urlGenerator,
$this->
createMock('Drupal\Core\Extension\ModuleHandlerInterface'
),
$this->renderer
);
$this->renderer
->
method('render'
) ->
willReturnCallback( // Pretend to do a render.
function D&
$elements,
$is_root_call = FALSE
) { // Mock the ability to theme links
$link =
$this->linkGenerator->
generate($elements['#title'
],
$elements['#url'
]);
if (isset($elements['#prefix'
])) { $link =
$elements['#prefix'
] .
$link;
} if (isset($elements['#suffix'
])) {