function OEmbedSourceTest::providerThumbnailUri

Same name in other branches
  1. 10 core/modules/media/tests/src/Kernel/OEmbedSourceTest.php \Drupal\Tests\media\Kernel\OEmbedSourceTest::providerThumbnailUri()
  2. 11.x core/modules/media/tests/src/Kernel/OEmbedSourceTest.php \Drupal\Tests\media\Kernel\OEmbedSourceTest::providerThumbnailUri()

Data provider for ::testThumbnailUri().

Return value

array Sets of arguments to pass to the test method.

File

core/modules/media/tests/src/Kernel/OEmbedSourceTest.php, line 53

Class

OEmbedSourceTest
@coversDefaultClass \Drupal\media\Plugin\media\Source\OEmbed

Namespace

Drupal\Tests\media\Kernel

Code

public function providerThumbnailUri() : array {
    return [
        'no query string, extension in URL' => [
            'internal:/core/misc/druplicon.png',
            [],
            'png',
        ],
        'with query string, extension in URL' => [
            'internal:/core/misc/druplicon.png?foo=bar',
            [],
            'png',
        ],
        'no query string or extension in URL, has MIME type' => [
            'internal:/core/misc/druplicon',
            [
                'Content-Type' => [
                    'image/png',
                ],
            ],
            'png',
        ],
        'query string but no extension in URL, has MIME type' => [
            'internal:/core/misc/druplicon?pasta=ravioli',
            [
                'Content-Type' => [
                    'image/png',
                ],
            ],
            'png',
        ],
        'no query string, MIME type, or extension in URL' => [
            'internal:/core/misc/druplicon',
            [],
            '',
        ],
    ];
}

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