function IFrameUrlHelperTest::providerIsSecure

Same name and namespace in other branches
  1. 9 core/modules/media/tests/src/Unit/IFrameUrlHelperTest.php \Drupal\Tests\media\Unit\IFrameUrlHelperTest::providerIsSecure()
  2. 8.9.x 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 26

Class

IFrameUrlHelperTest
@coversDefaultClass \Drupal\media\IFrameUrlHelper[[api-linebreak]]

Namespace

Drupal\Tests\media\Unit

Code

public static 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.