function UnroutedUrlAssemblerTest::providerTestAssembleWithLocalUri

Same name in other branches
  1. 9 core/tests/Drupal/Tests/Core/Utility/UnroutedUrlAssemblerTest.php \Drupal\Tests\Core\Utility\UnroutedUrlAssemblerTest::providerTestAssembleWithLocalUri()
  2. 8.9.x core/tests/Drupal/Tests/Core/Utility/UnroutedUrlAssemblerTest.php \Drupal\Tests\Core\Utility\UnroutedUrlAssemblerTest::providerTestAssembleWithLocalUri()
  3. 10 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 125

Class

UnroutedUrlAssemblerTest
@coversDefaultClass \Drupal\Core\Utility\UnroutedUrlAssembler @group Utility

Namespace

Drupal\Tests\Core\Utility

Code

public static 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.