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; }