You are here

public function UnroutedUrlAssemblerTest::providerTestAssembleWithLocalUri in Drupal 10

Same name and namespace in other branches
  1. 8 core/tests/Drupal/Tests/Core/Utility/UnroutedUrlAssemblerTest.php \Drupal\Tests\Core\Utility\UnroutedUrlAssemblerTest::providerTestAssembleWithLocalUri()
  2. 9 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 \Drupal\Core\Utility\UnroutedUrlAssembler @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',
    ],
  ];
}