You are here

public function UnroutedUrlAssemblerTest::providerTestAssembleWithExternalUrl in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/tests/Drupal/Tests/Core/Utility/UnroutedUrlAssemblerTest.php \Drupal\Tests\Core\Utility\UnroutedUrlAssemblerTest::providerTestAssembleWithExternalUrl()

Provides test data for testAssembleWithExternalUrl

File

core/tests/Drupal/Tests/Core/Utility/UnroutedUrlAssemblerTest.php, line 95
Contains \Drupal\Tests\Core\Utility\UnroutedUrlAssemblerTest.

Class

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

Namespace

Drupal\Tests\Core\Utility

Code

public function providerTestAssembleWithExternalUrl() {
  return [
    [
      'http://example.com/test',
      [],
      'http://example.com/test',
    ],
    [
      'http://example.com/test',
      [
        'fragment' => 'example',
      ],
      'http://example.com/test#example',
    ],
    [
      'http://example.com/test',
      [
        'fragment' => 'example',
      ],
      'http://example.com/test#example',
    ],
    [
      'http://example.com/test',
      [
        'query' => [
          'foo' => 'bar',
        ],
      ],
      'http://example.com/test?foo=bar',
    ],
    [
      'http://example.com/test',
      [
        'https' => TRUE,
      ],
      'https://example.com/test',
    ],
    [
      'https://example.com/test',
      [
        'https' => FALSE,
      ],
      'http://example.com/test',
    ],
    [
      'https://example.com/test?foo=1#bar',
      [],
      'https://example.com/test?foo=1#bar',
    ],
    [
      '//www.drupal.org',
      [],
      '//www.drupal.org',
    ],
  ];
}