public function testGeneratePath() { $generator = $this->getMockBuilder('Symfony\\Component\\Routing\\Generator\\UrlGenerator')->disableOriginalConstructor()->getMock(); $app = new Application(Application::ENV_TEST); $app['url_generator'] = $generator; $ret = 'retval-' . mt_rand(); $route = 'route'; $generator->expects($this->once())->method('generate')->with($this->equalTo($route), $this->equalTo([]), $this->equalTo(UrlGenerator::ABSOLUTE_PATH))->will($this->returnValue($ret)); $this->assertEquals($ret, $app->path($route)); }