function UnroutedUrlTest::providerFromUri

Same name in other branches
  1. 9 core/tests/Drupal/Tests/Core/UnroutedUrlTest.php \Drupal\Tests\Core\UnroutedUrlTest::providerFromUri()
  2. 8.9.x core/tests/Drupal/Tests/Core/UnroutedUrlTest.php \Drupal\Tests\Core\UnroutedUrlTest::providerFromUri()
  3. 10 core/tests/Drupal/Tests/Core/UnroutedUrlTest.php \Drupal\Tests\Core\UnroutedUrlTest::providerFromUri()

Data provider for testFromUri().

File

core/tests/Drupal/Tests/Core/UnroutedUrlTest.php, line 81

Class

UnroutedUrlTest
@coversDefaultClass \Drupal\Core\Url @group UrlTest

Namespace

Drupal\Tests\Core

Code

public static function providerFromUri() {
    return [
        // [$uri, $is_external]
        // An external URI.
[
            'https://www.drupal.org',
            TRUE,
        ],
        // A protocol-relative URL.
[
            '//www.drupal.org',
            TRUE,
        ],
        // An internal, unrouted, base-relative URI.
[
            'base:robots.txt',
            FALSE,
        ],
        // Base-relative URIs with special characters.
[
            'base:AKI@&hO@',
            FALSE,
        ],
        [
            'base:(:;2&+h^',
            FALSE,
        ],
        // Various token formats.
[
            'base:node/[token]',
            FALSE,
        ],
        [
            'base:node/%',
            FALSE,
        ],
        [
            'base:node/[token:token]',
            FALSE,
        ],
        [
            'base:node/{{ token }}',
            FALSE,
        ],
    ];
}

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