function UrlTest::providerFromInvalidInternalUri

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

Data provider for testFromInvalidInternalUri().

File

core/tests/Drupal/Tests/Core/UrlTest.php, line 763

Class

UrlTest
@coversDefaultClass <a href="/api/drupal/core%21lib%21Drupal%21Core%21Url.php/class/Url/9" title="Defines an object that holds information about a URL." class="local">\Drupal\Core\Url</a> @group UrlTest

Namespace

Drupal\Tests\Core

Code

public function providerFromInvalidInternalUri() {
    return [
        // Normal paths without a leading slash.
'normal_path0' => [
            'kittens',
        ],
        'normal_path1' => [
            'kittens/bengal',
        ],
        // Path without a leading slash containing a fragment.
'fragment' => [
            'kittens#feeding',
        ],
        // Path without a leading slash containing a query string.
'without_leading_slash_query' => [
            'kittens?page=1000',
        ],
        // Paths with various token formats but no leading slash.
'path_with_tokens0' => [
            '[duckies]',
        ],
        'path_with_tokens1' => [
            '%bunnies',
        ],
        'path_with_tokens2' => [
            '{{ puppies }}',
        ],
        // Disallowed characters in the authority (host name) that are valid
        // elsewhere in the path.
'disallowed_hostname_chars0' => [
            '(:;2&+h^',
        ],
        'disallowed_hostname_chars1' => [
            'AKI@&hO@',
        ],
        // Leading slash with a domain.
'leading_slash_with_domain' => [
            '/http://example.com',
        ],
    ];
}

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