function PathValidatorTest::testIsValidWithExternalUrl

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Core/Path/PathValidatorTest.php \Drupal\Tests\Core\Path\PathValidatorTest::testIsValidWithExternalUrl()
  2. 8.9.x core/tests/Drupal/Tests/Core/Path/PathValidatorTest.php \Drupal\Tests\Core\Path\PathValidatorTest::testIsValidWithExternalUrl()
  3. 10 core/tests/Drupal/Tests/Core/Path/PathValidatorTest.php \Drupal\Tests\Core\Path\PathValidatorTest::testIsValidWithExternalUrl()

Tests the isValid() method for an external URL.

@covers ::isValid

File

core/tests/Drupal/Tests/Core/Path/PathValidatorTest.php, line 98

Class

PathValidatorTest
@coversDefaultClass <a href="/api/drupal/core%21lib%21Drupal%21Core%21Path%21PathValidator.php/class/PathValidator/11.x" title="Provides a default path validator and access checker." class="local">\Drupal\Core\Path\PathValidator</a> @group Routing

Namespace

Drupal\Tests\Core\Path

Code

public function testIsValidWithExternalUrl() : void {
    $this->accessAwareRouter
        ->expects($this->never())
        ->method('match');
    $this->assertTrue($this->pathValidator
        ->isValid('https://www.drupal.org'));
}

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