['node', NULL, FALSE, 'node'
],
['node/1', NULL, FALSE, 'node/1'
],
['node/2/edit', NULL, FALSE, 'node/2/edit'
],
['non-existent', NULL, FALSE, 'non-existent'
],
];
// $this->map has $collect_bubbleable_metadata = FALSE; also generate the
// $collect_bubbleable_metadata = TRUE case for ::generateFromRoute().
$generate_from_route_map =
[];
foreach ($this->map
as $values) { $generate_from_route_map[] =
$values;
$generate_from_route_map[] =
[$values[0
],
$values[1
],
$values[2
], TRUE,
(new GeneratedUrl())->
setGeneratedUrl($values[4
])];
} $this->urlGenerator =
$this->
createMock('Drupal\Core\Routing\UrlGeneratorInterface'
);
$this->urlGenerator->
expects($this->
any()) ->
method('generateFromRoute'
) ->
willReturnMap($generate_from_route_map);
$this->pathAliasManager =
$this->
createMock('Drupal\path_alias\AliasManagerInterface'
);
$this->pathAliasManager->
expects($this->
any()) ->
method('getPathByAlias'
) ->
willReturnMap($alias_map);