public function RoutingFixtures::complexRouteCollection

Returns a complex set of routes for testing.

Return value

\Symfony\Component\Routing\RouteCollection

File

drupal/core/modules/system/lib/Drupal/system/Tests/Routing/RoutingFixtures.php, line 83

Class

RoutingFixtures
Utility methods to generate sample data, database configuration, etc.

Namespace

Drupal\system\Tests\Routing

Code

public function complexRouteCollection() {
  $collection = new RouteCollection();
  $route = new Route('/path/{thing}/one');
  $route
    ->setRequirement('_method', 'GET');
  $collection
    ->add('route_a', $route);
  $route = new Route('/path/{thing}/one');
  $route
    ->setRequirement('_method', 'PUT');
  $collection
    ->add('route_b', $route);
  $route = new Route('/somewhere/{item}/over/the/rainbow');
  $route
    ->setRequirement('_method', 'GET');
  $collection
    ->add('route_c', $route);
  $route = new Route('/another/{thing}/about/{item}');
  $collection
    ->add('route_d', $route);
  $route = new Route('/path/add/one');
  $route
    ->setRequirement('_method', 'GET|HEAD');
  $collection
    ->add('route_e', $route);
  return $collection;
}