function SpecialAttributesRouteSubscriberTest::testOnRouteBuildingInvalidVariables
Same name in other branches
- 9 core/tests/Drupal/Tests/Core/EventSubscriber/SpecialAttributesRouteSubscriberTest.php \Drupal\Tests\Core\EventSubscriber\SpecialAttributesRouteSubscriberTest::testOnRouteBuildingInvalidVariables()
- 8.9.x core/tests/Drupal/Tests/Core/EventSubscriber/SpecialAttributesRouteSubscriberTest.php \Drupal\Tests\Core\EventSubscriber\SpecialAttributesRouteSubscriberTest::testOnRouteBuildingInvalidVariables()
- 10 core/tests/Drupal/Tests/Core/EventSubscriber/SpecialAttributesRouteSubscriberTest.php \Drupal\Tests\Core\EventSubscriber\SpecialAttributesRouteSubscriberTest::testOnRouteBuildingInvalidVariables()
Tests the onAlterRoutes method for invalid variables.
@dataProvider providerTestOnRouteBuildingInvalidVariables @covers ::onAlterRoutes
Parameters
\Symfony\Component\Routing\Route $route: The route to check.
File
-
core/
tests/ Drupal/ Tests/ Core/ EventSubscriber/ SpecialAttributesRouteSubscriberTest.php, line 97
Class
- SpecialAttributesRouteSubscriberTest
- @coversDefaultClass \Drupal\Core\EventSubscriber\SpecialAttributesRouteSubscriber @group EventSubscriber
Namespace
Drupal\Tests\Core\EventSubscriberCode
public function testOnRouteBuildingInvalidVariables(Route $route) : void {
$route_collection = new RouteCollection();
$route_collection->add('test', $route);
$event = new RouteBuildEvent($route_collection);
$subscriber = new SpecialAttributesRouteSubscriber();
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage('Route test uses reserved variable names:');
$subscriber->onAlterRoutes($event);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.