$route_provider =
$this->
createMock('Drupal\Core\Routing\RouteProviderInterface'
);
$route_provider->
expects($this->
any()) ->
method('getRouteByName'
) ->
with('test_route'
) ->
willReturn(new Route('/test-path'
));
$this->urlGenerator =
$this->
createMock('Drupal\Core\Routing\UrlGeneratorInterface'
);
$this->pathValidator =
$this->
createMock('Drupal\Core\Path\PathValidatorInterface'
);
$this->requestStack =
new RequestStack();
$this->requestStack->
push(new Request());
$this->unroutedUrlAssembler =
$this->
createMock('Drupal\Core\Utility\UnroutedUrlAssemblerInterface'
);
$this->linkGenerator =
$this->
createMock('Drupal\Core\Utility\LinkGeneratorInterface'
);
$this->renderer =
$this->
createMock('Drupal\Core\Render\RendererInterface'
);
$container_builder =
new ContainerBuilder();
$container_builder->
set('url_generator',
$this->urlGenerator
);
$container_builder->
set('path.validator',
$this->pathValidator
);
$container_builder->
set('unrouted_url_assembler',
$this->unroutedUrlAssembler
);
$container_builder->
set('request_stack',
$this->requestStack
);