function AccessAwareRouterTest::testCall
Same name in other branches
- 9 core/tests/Drupal/Tests/Core/Routing/AccessAwareRouterTest.php \Drupal\Tests\Core\Routing\AccessAwareRouterTest::testCall()
- 10 core/tests/Drupal/Tests/Core/Routing/AccessAwareRouterTest.php \Drupal\Tests\Core\Routing\AccessAwareRouterTest::testCall()
- 11.x core/tests/Drupal/Tests/Core/Routing/AccessAwareRouterTest.php \Drupal\Tests\Core\Routing\AccessAwareRouterTest::testCall()
Ensure that methods are passed to the wrapped router.
@covers ::__call
File
-
core/
tests/ Drupal/ Tests/ Core/ Routing/ AccessAwareRouterTest.php, line 125
Class
- AccessAwareRouterTest
- @coversDefaultClass \Drupal\Core\Routing\AccessAwareRouter @group Routing
Namespace
Drupal\Tests\Core\RoutingCode
public function testCall() {
$mock_router = $this->createMock('Symfony\\Component\\Routing\\RouterInterface');
$this->chainRouter = $this->getMockBuilder('Symfony\\Cmf\\Component\\Routing\\ChainRouter')
->disableOriginalConstructor()
->setMethods([
'add',
])
->getMock();
$this->chainRouter
->expects($this->once())
->method('add')
->with($mock_router)
->willReturnSelf();
$this->router = new AccessAwareRouter($this->chainRouter, $this->accessManager, $this->currentUser);
$this->router
->add($mock_router);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.