You are here

public function UrlTransformRelativeTest::providerFileUrlTransformRelative in Drupal 9

Same name and namespace in other branches
  1. 8 core/tests/Drupal/KernelTests/Core/File/UrlTransformRelativeTest.php \Drupal\KernelTests\Core\File\UrlTransformRelativeTest::providerFileUrlTransformRelative()

File

core/tests/Drupal/KernelTests/Core/File/UrlTransformRelativeTest.php, line 43

Class

UrlTransformRelativeTest
Tests url transform to relative.

Namespace

Drupal\KernelTests\Core\File

Code

public function providerFileUrlTransformRelative() {
  $data = [
    'http' => [
      'example.com',
      80,
      '',
      'http://example.com/page',
      '/page',
    ],
    'https' => [
      'example.com',
      443,
      'on',
      'https://example.com/page',
      '/page',
    ],
    'http 8080' => [
      'example.com',
      8080,
      '',
      'https://example.com:8080/page',
      '/page',
    ],
    'https 8443' => [
      'example.com',
      8443,
      'on',
      'https://example.com:8443/page',
      '/page',
    ],
    'http no dot' => [
      'example.com',
      80,
      '',
      'http://exampleXcom/page',
      'http://exampleXcom/page',
    ],
    'http files on different port than the web request' => [
      'example.com',
      80,
      '',
      'http://example.com:9000/page',
      'http://example.com:9000/page',
    ],
    'https files on different port than the web request' => [
      'example.com',
      443,
      'on',
      'https://example.com:8443/page',
      'https://example.com:8443/page',
    ],
  ];
  return $data;
}