$map[] =
['test_route_1',
['value' => 'example'
], '/test-route-1/example'
];
$this->paramConverter =
$this->
createMock('Drupal\Core\ParamConverter\ParamConverterManagerInterface'
);
$this->paramConverter->
expects($this->
atLeastOnce()) ->
method('convert'
) ->
with(['value' => 'example', RouteObjectInterface::ROUTE_NAME => 'test_route_1', RouteObjectInterface::ROUTE_OBJECT =>
$route]) ->
willReturn(['value' => 'upcasted_value'
]);
$this->
setupAccessArgumentsResolverFactory($this->
exactly(2
)) ->
with($this->
callback(function D
$route_match) { return $route_match->
getParameters()->
get('value'
) == 'upcasted_value';
}));
$this->accessManager =
new AccessManager($this->routeProvider,
$this->paramConverter,
$this->argumentsResolverFactory,
$this->currentUser,
$this->checkProvider
);
$access_check =
$this->
createMock('Drupal\Tests\Core\Access\TestAccessCheckInterface'
);
$access_check->
expects($this->
atLeastOnce()) ->
method('applies'
) ->
willReturn(TRUE
);
$access_check->
expects($this->
atLeastOnce()) ->
method('access'
) ->
willReturn(AccessResult::
forbidden());