function MockRouteProvider::getAllRoutes

Same name and namespace in other branches
  1. 8.9.x core/modules/system/src/Tests/Routing/MockRouteProvider.php \Drupal\system\Tests\Routing\MockRouteProvider::getAllRoutes()
  2. 10 core/modules/system/src/Tests/Routing/MockRouteProvider.php \Drupal\system\Tests\Routing\MockRouteProvider::getAllRoutes()
  3. 11.x core/modules/system/src/Tests/Routing/MockRouteProvider.php \Drupal\system\Tests\Routing\MockRouteProvider::getAllRoutes()

Returns all the routes on the system.

Usage of this method is discouraged for performance reasons. If possible, use RouteProviderInterface::getRoutesByNames() or RouteProviderInterface::getRoutesByPattern() instead.

Return value

\Symfony\Component\Routing\Route[] An iterator of routes keyed by route name.

Overrides RouteProviderInterface::getAllRoutes

File

core/modules/system/src/Tests/Routing/MockRouteProvider.php, line 83

Class

MockRouteProvider
Easily configurable mock route provider.

Namespace

Drupal\system\Tests\Routing

Code

public function getAllRoutes() {
    return $this->routes
        ->all();
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.