/** * @return \Symfony\Cmf\Component\Routing\ChainRouter|\PHPUnit_Framework_MockObject_MockObject */ private function getRouterMock() { if (!isset($this->router)) { $this->router = $this->getMock('Symfony\\Cmf\\Component\\Routing\\ChainRouter'); $this->router->expects($this->any())->method('getContext')->will($this->returnValue(new RequestContext())); } return $this->router; }
/** * Ensure that methods are passed to the wrapped router. * * @covers ::__call */ public function testCall() { $mock_router = $this->getMock('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); }