function UnroutedUrlAssemblerTest::providerTestAssembleWithLocalUri

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

Return value

array

File

core/tests/Drupal/Tests/Core/Utility/UnroutedUrlAssemblerTest.php, line 123

Class

UnroutedUrlAssemblerTest
@coversDefaultClass <a href="/api/drupal/core%21lib%21Drupal%21Core%21Utility%21UnroutedUrlAssembler.php/class/UnroutedUrlAssembler/9" title="Provides a way to build external or non Drupal local domain URLs." class="local">\Drupal\Core\Utility\UnroutedUrlAssembler</a> @group Utility

Namespace

Drupal\Tests\Core\Utility

Code

public function providerTestAssembleWithLocalUri() {
    return [
        [
            'base:example',
            [],
            FALSE,
            '/example',
        ],
        [
            'base:example',
            [
                'query' => [
                    'foo' => 'bar',
                ],
            ],
            FALSE,
            '/example?foo=bar',
        ],
        [
            'base:example',
            [
                'query' => [
                    'foo' => '"bar"',
                ],
            ],
            FALSE,
            '/example?foo=%22bar%22',
        ],
        [
            'base:example',
            [
                'query' => [
                    'foo' => '"bar"',
                    'zoo' => 'baz',
                ],
            ],
            FALSE,
            '/example?foo=%22bar%22&zoo=baz',
        ],
        [
            'base:example',
            [
                'fragment' => 'example',
            ],
            FALSE,
            '/example#example',
        ],
        [
            'base:example',
            [],
            TRUE,
            '/subdir/example',
        ],
        [
            'base:example',
            [
                'query' => [
                    'foo' => 'bar',
                ],
            ],
            TRUE,
            '/subdir/example?foo=bar',
        ],
        [
            'base:example',
            [
                'fragment' => 'example',
            ],
            TRUE,
            '/subdir/example#example',
        ],
        [
            'base:/drupal.org',
            [],
            FALSE,
            '/drupal.org',
        ],
    ];
}

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