/**
* The router dumper to get all routes.
*
* @var \Drupal\Core\Routing\MatcherDumper
*/
protected $routerDumper;
/**
* Checks the behavior of the page for access denied/not found behaviors.
*/
public function testPageResponses() { \Drupal::
currentUser()->
setAccount(new AnonymousUserSession());
$subrequest = Request::
create('/test_page_display_403', 'GET'
);
$response =
$this->container->
get('http_kernel'
)->
handle($subrequest, HttpKernelInterface::SUB_REQUEST
);
$this->
assertEquals(403,
$response->
getStatusCode());
$subrequest = Request::
create('/test_page_display_404', 'GET'
);
$response =
$this->container->
get('http_kernel'
)->
handle($subrequest, HttpKernelInterface::SUB_REQUEST
);
$this->
assertEquals(404,
$response->
getStatusCode());
$subrequest = Request::
create('/test_page_display_200', 'GET'
);
$response =
$this->container->
get('http_kernel'
)->
handle($subrequest, HttpKernelInterface::SUB_REQUEST
);
$this->
assertEquals(200,
$response->
getStatusCode());