function UrlHelperTest::testInvalidAbsolute

Same name and namespace in other branches
  1. 11.x core/tests/Drupal/Tests/Component/Utility/UrlHelperTest.php \Drupal\Tests\Component\Utility\UrlHelperTest::testInvalidAbsolute()
  2. 10 core/tests/Drupal/Tests/Component/Utility/UrlHelperTest.php \Drupal\Tests\Component\Utility\UrlHelperTest::testInvalidAbsolute()
  3. 9 core/tests/Drupal/Tests/Component/Utility/UrlHelperTest.php \Drupal\Tests\Component\Utility\UrlHelperTest::testInvalidAbsolute()
  4. 8.9.x core/tests/Drupal/Tests/Component/Utility/UrlHelperTest.php \Drupal\Tests\Component\Utility\UrlHelperTest::testInvalidAbsolute()

Tests invalid absolute URLs.

@legacy-covers ::isValid

Attributes

#[DataProvider('providerTestInvalidAbsolute')]

Parameters

string $url: The URL to test.

string $scheme: The scheme to test.

File

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

Class

UrlHelperTest
Tests Drupal\Component\Utility\UrlHelper.

Namespace

Drupal\Tests\Component\Utility

Code

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

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.