function FileUrlGeneratorTest::providerGenerateURI

Same name in other branches
  1. 9 core/tests/Drupal/KernelTests/Core/File/FileUrlGeneratorTest.php \Drupal\KernelTests\Core\File\FileUrlGeneratorTest::providerGenerateURI()
  2. 10 core/tests/Drupal/KernelTests/Core/File/FileUrlGeneratorTest.php \Drupal\KernelTests\Core\File\FileUrlGeneratorTest::providerGenerateURI()

Data provider.

File

core/tests/Drupal/KernelTests/Core/File/FileUrlGeneratorTest.php, line 224

Class

FileUrlGeneratorTest
@coversDefaultClass \Drupal\Core\File\FileUrlGenerator

Namespace

Drupal\KernelTests\Core\File

Code

public static function providerGenerateURI() {
    return [
        'schemaless' => [
            '//core/assets/vendor/jquery/jquery.min.js',
            '//core/assets/vendor/jquery/jquery.min.js',
        ],
        'query string' => [
            '//core/assets/vendor/jquery/jquery.min.js?foo',
            '//core/assets/vendor/jquery/jquery.min.js?foo',
        ],
        'query string and hashes' => [
            '//core/assets/vendor/jquery/jquery.min.js?foo=bar#whizz',
            '//core/assets/vendor/jquery/jquery.min.js?foo=bar#whizz',
        ],
        'hashes' => [
            '//core/assets/vendor/jquery/jquery.min.js#whizz',
            '//core/assets/vendor/jquery/jquery.min.js#whizz',
        ],
        'root-relative' => [
            '/core/assets/vendor/jquery/jquery.min.js',
            'base:/core/assets/vendor/jquery/jquery.min.js',
        ],
        'relative' => [
            'core/assets/vendor/jquery/jquery.min.js',
            'base:core/assets/vendor/jquery/jquery.min.js',
        ],
        'external' => [
            'https://www.example.com/core/assets/vendor/jquery/jquery.min.js',
            'https://www.example.com/core/assets/vendor/jquery/jquery.min.js',
        ],
        'external stream wrapper' => [
            'dummy-external-readonly://core/assets/vendor/jquery/jquery.min.js',
            'https://www.dummy-external-readonly.com/core/assets/vendor/jquery/jquery.min.js',
        ],
        'external stream wrapper with query string' => [
            'dummy-external-readonly://core/assets/vendor/jquery/jquery.min.js?foo=bar',
            'https://www.dummy-external-readonly.com/core/assets/vendor/jquery/jquery.min.js?foo=bar',
        ],
        'external stream wrapper with hashes' => [
            'dummy-external-readonly://core/assets/vendor/jquery/jquery.min.js#whizz',
            'https://www.dummy-external-readonly.com/core/assets/vendor/jquery/jquery.min.js#whizz',
        ],
        'external stream wrapper with query string and hashes' => [
            'dummy-external-readonly://core/assets/vendor/jquery/jquery.min.js?foo=bar#whizz',
            'https://www.dummy-external-readonly.com/core/assets/vendor/jquery/jquery.min.js?foo=bar#whizz',
        ],
    ];
}

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