$subrequest = Request::
create('/test_page_display_200', 'GET'
);
$response =
$this->container->
get('http_kernel'
)->
handle($subrequest, HttpKernelInterface::SUB_REQUEST
);
$this->
assertEquals(200,
$response->
getStatusCode());
$subrequest = Request::
create('/test_page_display_200', 'GET'
);
\Drupal::
getContainer()->
get('request_stack'
)->
push($subrequest);
// Test accessing a disabled page for a view.
$view = Views::
getView('test_page_display'
);
// Disable the view, rebuild menu, and request the page again.
$view->storage->
disable()->
save();
// Router rebuild would occur in a kernel terminate event so we need to
// simulate that here.
\Drupal::
service('router.builder'
)->
rebuild();
$response =
$this->container->
get('http_kernel'
)->
handle($subrequest, HttpKernelInterface::SUB_REQUEST
);
$this->
assertEquals(404,
$response->
getStatusCode());
} /**
* Checks that the router items are properly registered.
*/