public function RoutingFixtures::duplicatePathsRouteCollection in Drupal 8
Same name and namespace in other branches
- 9 core/tests/Drupal/Tests/Core/Routing/RoutingFixtures.php \Drupal\Tests\Core\Routing\RoutingFixtures::duplicatePathsRouteCollection()
Returns a complex set of routes for testing.
Return value
\Symfony\Component\Routing\RouteCollection
File
- core/
tests/ Drupal/ Tests/ Core/ Routing/ RoutingFixtures.php, line 179
Class
- RoutingFixtures
- Utility methods to generate sample data, database configuration, etc.
Namespace
Drupal\Tests\Core\RoutingCode
public function duplicatePathsRouteCollection() {
$collection = new RouteCollection();
$route = new Route('/path/one');
$route
->setMethods([
'GET',
]);
$collection
->add('route_b', $route);
// Add the routes not in order by route name.
$route = new Route('/path/one');
$route
->setMethods([
'GET',
]);
$collection
->add('route_a', $route);
$route = new Route('/path/one');
$route
->setMethods([
'GET',
]);
$collection
->add('route_c', $route);
$route = new Route('/path/TWO');
$route
->setMethods([
'GET',
]);
$collection
->add('route_d', $route);
// Greek letters lower case phi (U+03C6) and lower case omega (U+03C9)
$route = new Route('/place/meφω');
$route
->setMethods([
'GET',
'HEAD',
]);
$collection
->add('route_f', $route);
$route = new Route('/PLACE/meφω');
$collection
->add('route_e', $route);
return $collection;
}