You are here

public function SpecialAttributesRouteSubscriberTest::providerTestOnRouteBuildingInvalidVariables in Drupal 8

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Core/EventSubscriber/SpecialAttributesRouteSubscriberTest.php \Drupal\Tests\Core\EventSubscriber\SpecialAttributesRouteSubscriberTest::providerTestOnRouteBuildingInvalidVariables()
  2. 10 core/tests/Drupal/Tests/Core/EventSubscriber/SpecialAttributesRouteSubscriberTest.php \Drupal\Tests\Core\EventSubscriber\SpecialAttributesRouteSubscriberTest::providerTestOnRouteBuildingInvalidVariables()

Provides a list of routes with invalid route variables.

Return value

array An array of invalid routes.

File

core/tests/Drupal/Tests/Core/EventSubscriber/SpecialAttributesRouteSubscriberTest.php, line 25

Class

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

Namespace

Drupal\Tests\Core\EventSubscriber

Code

public function providerTestOnRouteBuildingInvalidVariables() {

  // Build an array of mock route objects based on paths.
  $routes = [];
  $paths = [
    '/test/{system_path}',
    '/test/{_legacy}',
    '/test/{' . RouteObjectInterface::ROUTE_OBJECT . '}',
    '/test/{' . RouteObjectInterface::ROUTE_NAME . '}',
    '/test/{_content}',
    '/test/{_form}',
    '/test/{_raw_variables}',
  ];
  foreach ($paths as $path) {
    $routes[] = [
      new Route($path),
    ];
  }
  return $routes;
}