$http_kernel = \Drupal::
service('http_kernel'
);
return $http_kernel->
handle($request, HttpKernelInterface::SUB_REQUEST
)->
getContent();
} /**
* @covers \Drupal\Core\Entity\Routing\DefaultHtmlRouteProvider::getRoutes
*/
public function testHtmlRoutes() { /** @var \Drupal\Core\Routing\RouteProviderInterface $route_provider */
$route_provider = \Drupal::
service('router.route_provider'
);
$route =
$route_provider->
getRouteByName('entity.entity_test_mul.canonical'
);
$this->
assertEquals('entity_test_mul.full',
$route->
getDefault('_entity_view'
));
$this->
assertEquals('\Drupal\Core\Entity\Controller\EntityController::title',
$route->
getDefault('_title_callback'
));
$this->
assertEquals('entity_test_mul.view',
$route->
getRequirement('_entity_access'
));
$this->
assertFalse($route->
hasOption('_admin_route'
));
$route =
$route_provider->
getRouteByName('entity.entity_test_mul.edit_form'
);
$this->
assertEquals('entity_test_mul.default',
$route->
getDefault('_entity_form'
));
$this->
assertEquals('\Drupal\Core\Entity\Controller\EntityController::editTitle',
$route->
getDefault('_title_callback'
));
$this->
assertEquals('entity_test_mul.update',
$route->
getRequirement('_entity_access'
));
$this->
assertFalse($route->
hasOption('_admin_route'
));