You are here

private function RenameAdminPathEventSubscriberTest::getRouteCollection in Rename Admin Paths 8.2

Return value

\Symfony\Component\Routing\RouteCollection

1 call to RenameAdminPathEventSubscriberTest::getRouteCollection()
RenameAdminPathEventSubscriberTest::assertRoutePaths in tests/src/Unit/EventSubscriber/RenameAdminPathEventSubscriberTest.php

File

tests/src/Unit/EventSubscriber/RenameAdminPathEventSubscriberTest.php, line 162

Class

RenameAdminPathEventSubscriberTest
@group tests

Namespace

Drupal\Tests\rename_admin_paths\Unit\EventSubscriber

Code

private function getRouteCollection() {
  $routeCollection = new RouteCollection();
  foreach ([
    'home' => '/',
    'about' => '/about',
    'admin' => '/admin',
    'admin_slashed' => '/admin/',
    'admin_sub' => '/admin/sub',
    'admin_sub_sub' => '/admin/sub/sub',
    'admin_admin' => '/admin/admin',
    'admin_sub_admin' => '/admin/sub/admin',
    'admins' => '/admins',
    'admins_sub' => '/admins/sub',
    'user' => '/user',
    'user_slashed' => '/user/',
    'user_sub' => '/user/sub',
    'user_sub_sub' => '/user/sub/sub',
    'user_admin' => '/user/user',
    'user_sub_admin' => '/user/sub/user',
    'users' => '/users',
    'users_sub' => '/users/sub',
  ] as $name => $path) {
    $routeCollection
      ->add($name, new Route($path));
  }
  return $routeCollection;
}