You are here

public function UrlHelperTest::testValidAbsolute in Drupal 9

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

Tests valid absolute URLs.

@dataProvider providerTestValidAbsoluteData @covers ::isValid

Parameters

string $url: The url to test.

string $scheme: The scheme to test.

File

core/tests/Drupal/Tests/Component/Utility/UrlHelperTest.php, line 88

Class

UrlHelperTest
@group Utility

Namespace

Drupal\Tests\Component\Utility

Code

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