function AccessAwareRouterTest::setupRouter
Same name and namespace in other branches
- 9 core/tests/Drupal/Tests/Core/Routing/AccessAwareRouterTest.php \Drupal\Tests\Core\Routing\AccessAwareRouterTest::setupRouter()
- 8.9.x core/tests/Drupal/Tests/Core/Routing/AccessAwareRouterTest.php \Drupal\Tests\Core\Routing\AccessAwareRouterTest::setupRouter()
- 10 core/tests/Drupal/Tests/Core/Routing/AccessAwareRouterTest.php \Drupal\Tests\Core\Routing\AccessAwareRouterTest::setupRouter()
Sets up a chain router with matchRequest.
3 calls to AccessAwareRouterTest::setupRouter()
- AccessAwareRouterTest::testCheckAccessResultWithReason in core/
tests/ Drupal/ Tests/ Core/ Routing/ AccessAwareRouterTest.php - Tests the matchRequest() function for access denied with reason message.
- AccessAwareRouterTest::testMatchRequestAllowed in core/
tests/ Drupal/ Tests/ Core/ Routing/ AccessAwareRouterTest.php - Tests the matchRequest() function for access allowed.
- AccessAwareRouterTest::testMatchRequestDenied in core/
tests/ Drupal/ Tests/ Core/ Routing/ AccessAwareRouterTest.php - Tests the matchRequest() function for access denied.
File
-
core/
tests/ Drupal/ Tests/ Core/ Routing/ AccessAwareRouterTest.php, line 67
Class
- AccessAwareRouterTest
- @coversDefaultClass <a href="/api/drupal/core%21lib%21Drupal%21Core%21Routing%21AccessAwareRouter.php/class/AccessAwareRouter/11.x" title="A router class for Drupal with access check and upcasting." class="local">\Drupal\Core\Routing\AccessAwareRouter</a> @group Routing
Namespace
Drupal\Tests\Core\RoutingCode
protected function setupRouter() {
$this->router = $this->getMockBuilder('Drupal\\Core\\Routing\\Router')
->disableOriginalConstructor()
->getMock();
$this->router
->expects($this->once())
->method('matchRequest')
->willReturn([
RouteObjectInterface::ROUTE_OBJECT => $this->route,
]);
$this->accessAwareRouter = new AccessAwareRouter($this->router, $this->accessManager, $this->currentUser);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.