function PathValidatorTest::testGetUrlIfValidWithoutAccessCheckWithInvalidPath
Tests the getUrlIfValidWithoutAccessCheck() method with an invalid path.
@legacy-covers ::getUrlIfValidWithoutAccessCheck @legacy-covers ::getUrl
File
-
core/
tests/ Drupal/ Tests/ Core/ Path/ PathValidatorTest.php, line 463
Class
Namespace
Drupal\Tests\Core\PathCode
public function testGetUrlIfValidWithoutAccessCheckWithInvalidPath() : void {
// URLs must not start nor end with ASCII control characters or spaces.
$this->assertFalse($this->pathValidator
->getUrlIfValidWithoutAccessCheck('foo '));
// Also check URL-encoded variant.
$this->pathProcessor
->expects($this->once())
->method('processInbound')
->willReturnArgument(0);
$this->assertFalse($this->pathValidator
->getUrlIfValidWithoutAccessCheck('foo%20'));
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.