function SpecialAttributesRouteSubscriberTest::providerTestOnRouteBuildingValidVariables

Same name in other branches
  1. 8.9.x core/tests/Drupal/Tests/Core/EventSubscriber/SpecialAttributesRouteSubscriberTest.php \Drupal\Tests\Core\EventSubscriber\SpecialAttributesRouteSubscriberTest::providerTestOnRouteBuildingValidVariables()
  2. 10 core/tests/Drupal/Tests/Core/EventSubscriber/SpecialAttributesRouteSubscriberTest.php \Drupal\Tests\Core\EventSubscriber\SpecialAttributesRouteSubscriberTest::providerTestOnRouteBuildingValidVariables()
  3. 11.x core/tests/Drupal/Tests/Core/EventSubscriber/SpecialAttributesRouteSubscriberTest.php \Drupal\Tests\Core\EventSubscriber\SpecialAttributesRouteSubscriberTest::providerTestOnRouteBuildingValidVariables()

Provides a list of routes with valid route variables.

Return value

array An array of valid routes.

File

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

Class

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

Namespace

Drupal\Tests\Core\EventSubscriber

Code

public function providerTestOnRouteBuildingValidVariables() {
    // Build an array of mock route objects based on paths.
    $routes = [];
    $paths = [
        '/test/{account}',
        '/test/{node}',
        '/test/{user}',
        '/test/{entity_test}',
    ];
    foreach ($paths as $path) {
        $routes[] = [
            new Route($path),
        ];
    }
    return $routes;
}

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