function PathValidatorTest::setUpMockAccount

Reinitializes the account as a mock object.

13 calls to PathValidatorTest::setUpMockAccount()
PathValidatorTest::testGetUrlIfValidWithAccess in core/tests/Drupal/Tests/Core/Path/PathValidatorTest.php
Tests the getUrlIfValid() method when there is access.
PathValidatorTest::testGetUrlIfValidWithoutAccess in core/tests/Drupal/Tests/Core/Path/PathValidatorTest.php
Tests the getUrlIfValid() method where there is no access.
PathValidatorTest::testGetUrlIfValidWithoutAccessCheck in core/tests/Drupal/Tests/Core/Path/PathValidatorTest.php
Tests the getUrlIfValidWithoutAccessCheck() method.
PathValidatorTest::testGetUrlIfValidWithQuery in core/tests/Drupal/Tests/Core/Path/PathValidatorTest.php
Tests the getUrlIfValid() method with a query in the path.
PathValidatorTest::testIsValidWithAccessDenied in core/tests/Drupal/Tests/Core/Path/PathValidatorTest.php
Tests the isValid() method with a user without access to the path.

... See full list

File

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

Class

PathValidatorTest
Tests Drupal\Core\Path\PathValidator.

Namespace

Drupal\Tests\Core\Path

Code

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

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