class TestRouteSubscriber

Same name in this branch
  1. 10 core/modules/views/tests/src/Unit/EventSubscriber/RouteSubscriberTest.php \Drupal\Tests\views\Unit\EventSubscriber\TestRouteSubscriber
Same name in other branches
  1. 9 core/modules/views/tests/src/Unit/EventSubscriber/RouteSubscriberTest.php \Drupal\Tests\views\Unit\EventSubscriber\TestRouteSubscriber
  2. 9 core/tests/Drupal/Tests/Core/Routing/RouteBuilderTest.php \Drupal\Tests\Core\Routing\TestRouteSubscriber
  3. 8.9.x core/modules/views/tests/src/Unit/EventSubscriber/RouteSubscriberTest.php \Drupal\Tests\views\Unit\EventSubscriber\TestRouteSubscriber
  4. 8.9.x core/tests/Drupal/Tests/Core/Routing/RouteBuilderTest.php \Drupal\Tests\Core\Routing\TestRouteSubscriber
  5. 11.x core/modules/views/tests/src/Unit/EventSubscriber/RouteSubscriberTest.php \Drupal\Tests\views\Unit\EventSubscriber\TestRouteSubscriber
  6. 11.x 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 358

Namespace

Drupal\Tests\Core\Routing
View source
class TestRouteSubscriber {
    public function routesFromArray() {
        return [
            '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

Title Sort descending Modifiers Object type Summary
TestRouteSubscriber::routesFromArray public function
TestRouteSubscriber::routesFromCollection public function

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.