function RouteCompilerTest::providerTestGetFit

Same name and namespace in other branches
  1. 8.9.x core/tests/Drupal/Tests/Core/Routing/RouteCompilerTest.php \Drupal\Tests\Core\Routing\RouteCompilerTest::providerTestGetFit()
  2. 10 core/tests/Drupal/Tests/Core/Routing/RouteCompilerTest.php \Drupal\Tests\Core\Routing\RouteCompilerTest::providerTestGetFit()
  3. 11.x core/tests/Drupal/Tests/Core/Routing/RouteCompilerTest.php \Drupal\Tests\Core\Routing\RouteCompilerTest::providerTestGetFit()

Provides data for RouteCompilerTest::testGetFit()

Return value

array An array of arrays, where each inner array has the path whose fit is to be calculated as the first value and the expected fit as the second value.

File

core/tests/Drupal/Tests/Core/Routing/RouteCompilerTest.php, line 40

Class

RouteCompilerTest
@coversDefaultClass <a href="/api/drupal/core%21lib%21Drupal%21Core%21Routing%21RouteCompiler.php/class/RouteCompiler/9" title="Compiler to generate derived information from a Route necessary for matching." class="local">\Drupal\Core\Routing\RouteCompiler</a> @group Routing

Namespace

Drupal\Tests\Core\Routing

Code

public function providerTestGetFit() {
    return [
        [
            'test',
            1,
        ],
        [
            '/testwithleadingslash',
            1,
        ],
        [
            'testwithtrailingslash/',
            1,
        ],
        [
            '/testwithslashes/',
            1,
        ],
        [
            'test/with/multiple/parts',
            15,
        ],
        [
            'test/with/{some}/slugs',
            13,
        ],
        [
            'test/very/long/path/that/drupal/7/could/not/have/handled',
            2047,
        ],
    ];
}

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