function IFrameUrlHelperTest::providerIsSecure

Same name in other branches
  1. 9 core/modules/media/tests/src/Unit/IFrameUrlHelperTest.php \Drupal\Tests\media\Unit\IFrameUrlHelperTest::providerIsSecure()
  2. 10 core/modules/media/tests/src/Unit/IFrameUrlHelperTest.php \Drupal\Tests\media\Unit\IFrameUrlHelperTest::providerIsSecure()
  3. 11.x core/modules/media/tests/src/Unit/IFrameUrlHelperTest.php \Drupal\Tests\media\Unit\IFrameUrlHelperTest::providerIsSecure()

Data provider for testIsSecure().

Return value

array

See also

::testIsSecure()

File

core/modules/media/tests/src/Unit/IFrameUrlHelperTest.php, line 24

Class

IFrameUrlHelperTest
@coversDefaultClass \Drupal\media\IFrameUrlHelper

Namespace

Drupal\Tests\media\Unit

Code

public function providerIsSecure() {
    return [
        'no domain' => [
            '/path/to/media.php',
            'http://www.example.com/',
            FALSE,
        ],
        'no base URL domain' => [
            'http://www.example.com/media.php',
            '/invalid/base/url',
            FALSE,
        ],
        'same domain' => [
            'http://www.example.com/media.php',
            'http://www.example.com/',
            FALSE,
        ],
        'different domain' => [
            'http://www.example.com/media.php',
            'http://www.example-assets.com/',
            TRUE,
        ],
        'same subdomain' => [
            'http://foo.example.com/media.php',
            'http://foo.example.com/',
            FALSE,
        ],
        'different subdomain' => [
            'http://assets.example.com/media.php',
            'http://foo.example.com/',
            TRUE,
        ],
        'subdomain and top-level domain' => [
            'http://assets.example.com/media.php',
            'http://example.com/',
            TRUE,
        ],
    ];
}

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