function UrlTest::setUpMockPathValidator

Reinitializes the path validator as a mock object.

2 calls to UrlTest::setUpMockPathValidator()
UrlTest::testFromRoutedPathWithInvalidRoute in core/tests/Drupal/Tests/Core/UrlTest.php
Tests fromUri() method with a user-entered path not matching any route.
UrlTest::testFromRoutedPathWithValidRoute in core/tests/Drupal/Tests/Core/UrlTest.php
Tests fromUri() method with user-entered path matching a valid route.

File

core/tests/Drupal/Tests/Core/UrlTest.php, line 137

Class

UrlTest
Tests Drupal\Core\Url.

Namespace

Drupal\Tests\Core

Code

protected function setUpMockPathValidator() : void {
  $this->pathValidator = $this->createMock(PathValidatorInterface::class);
  $this->container
    ->set('path.validator', $this->pathValidator);
}

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