function PathValidatorTest::setUpMockAccessUnawareRouter

Reinitializes the access unaware router as a mock object.

10 calls to PathValidatorTest::setUpMockAccessUnawareRouter()
PathValidatorTest::testGetUrlIfValidWithoutAccessCheck in core/tests/Drupal/Tests/Core/Path/PathValidatorTest.php
Tests the getUrlIfValidWithoutAccessCheck() method.
PathValidatorTest::testIsValidWithAccessDenied in core/tests/Drupal/Tests/Core/Path/PathValidatorTest.php
Tests the isValid() method with a user without access to the path.
PathValidatorTest::testIsValidWithFailingParameterConverting in core/tests/Drupal/Tests/Core/Path/PathValidatorTest.php
Tests the isValid() method with a not working param converting.
PathValidatorTest::testIsValidWithLinkToAnyPageAccount in core/tests/Drupal/Tests/Core/Path/PathValidatorTest.php
Tests the isValid() method with a 'link to any page' permission.
PathValidatorTest::testIsValidWithMethodNotAllowed in core/tests/Drupal/Tests/Core/Path/PathValidatorTest.php
Tests is valid with method not allowed.

... See full list

File

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

Class

PathValidatorTest
Tests Drupal\Core\Path\PathValidator.

Namespace

Drupal\Tests\Core\Path

Code

protected function setUpMockAccessUnawareRouter() : void {
  $this->accessUnawareRouter = $this->createMock(UrlMatcherInterface::class);
  $reflection = new \ReflectionProperty($this->pathValidator, 'accessUnawareRouter');
  $reflection->setValue($this->pathValidator, $this->accessUnawareRouter);
}

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