You are here

public function SpecialAttributesRouteSubscriberTest::testOnRouteBuildingInvalidVariables in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/tests/Drupal/Tests/Core/EventSubscriber/SpecialAttributesRouteSubscriberTest.php \Drupal\Tests\Core\EventSubscriber\SpecialAttributesRouteSubscriberTest::testOnRouteBuildingInvalidVariables()

Tests the onAlterRoutes method for invalid variables.

@dataProvider providerTestOnRouteBuildingInvalidVariables @expectedException \PHPUnit_Framework_Error_Warning @expectedExceptionMessage uses reserved variable names

@covers ::onAlterRoutes

Parameters

\Symfony\Component\Routing\Route $route: The route to check.

File

core/tests/Drupal/Tests/Core/EventSubscriber/SpecialAttributesRouteSubscriberTest.php, line 102
Contains \Drupal\Tests\Core\EventSubscriber\SpecialAttributesRouteSubscriberTest.

Class

SpecialAttributesRouteSubscriberTest
@coversDefaultClass \Drupal\Core\EventSubscriber\SpecialAttributesRouteSubscriber @group EventSubscriber

Namespace

Drupal\Tests\Core\EventSubscriber

Code

public function testOnRouteBuildingInvalidVariables(Route $route) {
  $route_collection = $this
    ->getMock('Symfony\\Component\\Routing\\RouteCollection', NULL);
  $route_collection
    ->add('test', $route);
  $event = new RouteBuildEvent($route_collection, 'test');
  $subscriber = new SpecialAttributesRouteSubscriber();
  $subscriber
    ->onAlterRoutes($event);
}