You are here

public static function UrlHelperTest::providerTestIsExternal in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/tests/Drupal/Tests/Component/Utility/UrlHelperTest.php \Drupal\Tests\Component\Utility\UrlHelperTest::providerTestIsExternal()

Provides data for self::testIsExternal().

Return value

array

File

core/tests/Drupal/Tests/Component/Utility/UrlHelperTest.php, line 355
Contains \Drupal\Tests\Component\Utility\UrlHelperTest.

Class

UrlHelperTest
@group Utility

Namespace

Drupal\Tests\Component\Utility

Code

public static function providerTestIsExternal() {
  return array(
    array(
      '/internal/path',
      FALSE,
    ),
    array(
      'https://example.com/external/path',
      TRUE,
    ),
    array(
      'javascript://fake-external-path',
      FALSE,
    ),
    // External URL without an explicit protocol.
    array(
      '//www.drupal.org/foo/bar?foo=bar&bar=baz&baz#foo',
      TRUE,
    ),
    // Internal URL starting with a slash.
    array(
      '/www.drupal.org',
      FALSE,
    ),
  );
}