You are here

public function UrlHelperTest::testInvalidAbsolute in Drupal 10

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

Tests invalid absolute URLs.

@dataProvider providerTestInvalidAbsolute @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 120

Class

UrlHelperTest
@group Utility

Namespace

Drupal\Tests\Component\Utility

Code

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