class TestRouteSubscriber in Drupal 8
Same name in this branch
- 8 core/tests/Drupal/Tests/Core/Routing/RouteBuilderTest.php \Drupal\Tests\Core\Routing\TestRouteSubscriber
- 8 core/modules/views/tests/src/Unit/EventSubscriber/RouteSubscriberTest.php \Drupal\Tests\views\Unit\EventSubscriber\TestRouteSubscriber
Provides a callback for route definition.
Hierarchy
- class \Drupal\Tests\Core\Routing\TestRouteSubscriber
Expanded class hierarchy of TestRouteSubscriber
File
- core/
tests/ Drupal/ Tests/ Core/ Routing/ RouteBuilderTest.php, line 358 - Contains \Drupal\Tests\Core\Routing\RouteBuilderTest.
Namespace
Drupal\Tests\Core\RoutingView 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
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
TestRouteSubscriber:: |
public | function | ||
TestRouteSubscriber:: |
public | function |