function UrlHelperTest::testValidRelative
Same name in other branches
- 8.9.x core/tests/Drupal/Tests/Component/Utility/UrlHelperTest.php \Drupal\Tests\Component\Utility\UrlHelperTest::testValidRelative()
- 10 core/tests/Drupal/Tests/Component/Utility/UrlHelperTest.php \Drupal\Tests\Component\Utility\UrlHelperTest::testValidRelative()
- 11.x 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 154
Class
- UrlHelperTest
- @group Utility
Namespace
Drupal\Tests\Component\UtilityCode
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.');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.