/**
* Sets up a chain router with matchRequest.
*/
protected function setupRouter() { $this->router =
$this->
getMockBuilder('Drupal\Core\Routing\Router'
) ->
disableOriginalConstructor() ->
getMock();
$this->router->
expects($this->
once()) ->
method('matchRequest'
) ->
willReturn([RouteObjectInterface::ROUTE_OBJECT =>
$this->route
]);
$this->accessAwareRouter =
new AccessAwareRouter($this->router,
$this->accessManager,
$this->currentUser
);
} /**
* Tests the matchRequest() function for access allowed.
*/
public function testMatchRequestAllowed() { $this->
setupRouter();
$request =
new Request();
$access_result = AccessResult::
allowed();
$this->accessManager->
expects($this->
once()) ->
method('checkRequest'
)