$request = Request::
create('/'
);
$request->attributes->
set(RouteObjectInterface::ROUTE_NAME, '<front>'
);
$request->attributes->
set(RouteObjectInterface::ROUTE_OBJECT,
new Route('/'
));
$request_stack->
push($request);
$request_context->
fromRequest($request);
$menu_tree = \Drupal::
menuTree();
$renderer = \Drupal::
service('renderer'
);
$default_menu_cacheability =
(new BubbleableMetadata()) ->
setCacheMaxAge(Cache::PERMANENT
) ->
setCacheTags(['config:system.menu.tools'
]) ->
setCacheContexts(['languages:' . LanguageInterface::TYPE_INTERFACE, 'theme', 'user.permissions'
]);
User::
create(['uid' => 1, 'name' =>
$this->
randomString()])->
save();
User::
create(['uid' => 2, 'name' =>
$this->
randomString()])->
save();
// Five test cases, four asserting one outbound path/route processor, and
// together covering one of each:
// - no cacheability metadata,
// - a cache context,
// - a cache tag,
// - a cache max-age.