public function testGenerateObjectName() {
$name = new \stdClass();
$parameters = array(
'test' => 'value',
);
$defaultRouter = $this
->getMock('Symfony\\Component\\Routing\\RouterInterface');
$chainedRouter = $this
->getMock('Symfony\\Cmf\\Component\\Routing\\ChainedRouterInterface');
$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);
}