public function ChainRouterTest::testGenerateObjectName in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/symfony-cmf/routing/Tests/Routing/ChainRouterTest.php \Symfony\Cmf\Component\Routing\Tests\Routing\ChainRouterTest::testGenerateObjectName()
File
- vendor/
symfony-cmf/ routing/ Tests/ Routing/ ChainRouterTest.php, line 597
Class
Namespace
Symfony\Cmf\Component\Routing\Tests\RoutingCode
public function testGenerateObjectName() {
$name = new \stdClass();
$parameters = array(
'test' => 'value',
);
$defaultRouter = $this
->getMock('Symfony\\Component\\Routing\\RouterInterface');
$chainedRouter = $this
->getMock('Symfony\\Cmf\\Component\\Routing\\Tests\\Routing\\VersatileRouter');
$defaultRouter
->expects($this
->never())
->method('generate');
$chainedRouter
->expects($this
->once())
->method('supports')
->will($this
->returnValue(true));
$chainedRouter
->expects($this
->once())
->method('generate')
->with($name, $parameters, false)
->will($this
->returnValue($name));
$this->router
->add($defaultRouter, 200);
$this->router
->add($chainedRouter, 100);
$result = $this->router
->generate($name, $parameters);
$this
->assertEquals($name, $result);
}