You are here

public function MockRouteProvider::getRouteCollectionForRequest in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/system/src/Tests/Routing/MockRouteProvider.php \Drupal\system\Tests\Routing\MockRouteProvider::getRouteCollectionForRequest()

Implements \Drupal\Core\Routing\RouteProviderInterface::getRouteCollectionForRequest().

Simply return all routes to prevent \Symfony\Component\Routing\Exception\ResourceNotFoundException.

Overrides RouteProviderInterface::getRouteCollectionForRequest

File

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

Class

MockRouteProvider
Easily configurable mock route provider.

Namespace

Drupal\system\Tests\Routing

Code

public function getRouteCollectionForRequest(Request $request) {
  return $this->routes;
}