You are here

class TestRouteSubscriber in Zircon Profile 8

Same name in this branch
  1. 8 core/tests/Drupal/Tests/Core/Routing/RouteBuilderTest.php \Drupal\Tests\Core\Routing\TestRouteSubscriber
  2. 8 core/modules/views/tests/src/Unit/EventSubscriber/RouteSubscriberTest.php \Drupal\Tests\views\Unit\EventSubscriber\TestRouteSubscriber
Same name and namespace in other branches
  1. 8.0 core/tests/Drupal/Tests/Core/Routing/RouteBuilderTest.php \Drupal\Tests\Core\Routing\TestRouteSubscriber

Provides a callback for route definition.

Hierarchy

Expanded class hierarchy of TestRouteSubscriber

File

core/tests/Drupal/Tests/Core/Routing/RouteBuilderTest.php, line 312
Contains \Drupal\Tests\Core\Routing\RouteBuilderTest.

Namespace

Drupal\Tests\Core\Routing
View source
class TestRouteSubscriber {
  public function routesFromArray() {
    return array(
      'test_route.1' => new Route('/test-route/1'),
    );
  }
  public function routesFromCollection() {
    $collection = new RouteCollection();
    $collection
      ->add('test_route.2', new Route('/test-route/2'));
    return $collection;
  }

}

Members