function UrlHelperTest::testValidAbsolute
Tests valid absolute URLs.
@legacy-covers ::isValid
Attributes
#[DataProvider('providerTestValidAbsoluteData')]
Parameters
string $url: The URL to test.
string $scheme: The scheme to test.
File
-
core/
tests/ Drupal/ Tests/ Component/ Utility/ UrlHelperTest.php, line 100
Class
Namespace
Drupal\Tests\Component\UtilityCode
public function testValidAbsolute(string $url, string $scheme) : void {
$test_url = $scheme . '://' . $url;
$valid_url = UrlHelper::isValid($test_url, TRUE);
$this->assertTrue($valid_url, $test_url . ' is a valid URL.');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.