You are here

protected function RouteProvider::lazyLoadItself in Drupal 10

Same name and namespace in other branches
  1. 8 core/tests/Drupal/KernelTests/RouteProvider.php \Drupal\KernelTests\RouteProvider::lazyLoadItself()
  2. 9 core/tests/Drupal/KernelTests/RouteProvider.php \Drupal\KernelTests\RouteProvider::lazyLoadItself()

Loads the real route provider from the container and rebuilds the router.

Return value

\Drupal\Core\Routing\PreloadableRouteProviderInterface|\Symfony\Component\EventDispatcher\EventSubscriberInterface The route provider.

9 calls to RouteProvider::lazyLoadItself()
RouteProvider::getAllRoutes in core/tests/Drupal/KernelTests/RouteProvider.php
Returns all the routes on the system.
RouteProvider::getCandidateOutlines in core/tests/Drupal/KernelTests/RouteProvider.php
RouteProvider::getRouteByName in core/tests/Drupal/KernelTests/RouteProvider.php
Find the route using the provided route name.
RouteProvider::getRouteCollectionForRequest in core/tests/Drupal/KernelTests/RouteProvider.php
Finds routes that may potentially match the request.
RouteProvider::getRoutesByNames in core/tests/Drupal/KernelTests/RouteProvider.php
Find many routes by their names using the provided list of names.

... See full list

File

core/tests/Drupal/KernelTests/RouteProvider.php, line 21

Class

RouteProvider
Rebuilds the router when the provider is instantiated.

Namespace

Drupal\KernelTests

Code

protected function lazyLoadItself() {
  if (!isset($this->service)) {
    $container = \Drupal::getContainer();
    $this->service = $container
      ->get('test.router.route_provider');
    $container
      ->get('router.builder')
      ->rebuild();
  }
  return $this->service;
}