You are here

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

Tests valid relative URLs.

@dataProvider providerTestValidRelativeData @covers ::isValid

Parameters

string $url: The url to test.

string $prefix: The prefix to test.

File

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

Class

UrlHelperTest
@group Utility

Namespace

Drupal\Tests\Component\Utility

Code

public function testValidRelative($url, $prefix) {
  $test_url = $prefix . $url;
  $valid_url = UrlHelper::isValid($test_url);
  $this
    ->assertTrue($valid_url, $test_url . ' is a valid URL.');
}