You are here

public function UrlHelperTest::testIsExternal 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::testIsExternal()

Tests external versus internal paths.

@dataProvider providerTestIsExternal @covers ::isExternal

Parameters

string $path: URL or path to test.

bool $expected: Expected result.

File

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

Class

UrlHelperTest
@group Utility

Namespace

Drupal\Tests\Component\Utility

Code

public function testIsExternal($path, $expected) {
  $isExternal = UrlHelper::isExternal($path);
  $this
    ->assertEquals($expected, $isExternal);
}