public function ContentAwareGeneratorTest::testGenerateRoutenameMultilang in Zircon Profile 8.0
Same name and namespace in other branches
- 8 vendor/symfony-cmf/routing/Tests/Routing/ContentAwareGeneratorTest.php \Symfony\Cmf\Component\Routing\Tests\Routing\ContentAwareGeneratorTest::testGenerateRoutenameMultilang()
File
- vendor/
symfony-cmf/ routing/ Tests/ Routing/ ContentAwareGeneratorTest.php, line 195
Class
Namespace
Symfony\Cmf\Component\Routing\Tests\RoutingCode
public function testGenerateRoutenameMultilang() {
$name = 'foo/bar';
$route_en = $this
->buildMock('Symfony\\Cmf\\Component\\Routing\\Tests\\Routing\\RouteMock', array(
'getDefaults',
'compile',
'getContent',
));
$route_en
->setLocale('en');
$route_de = $this->routeDocument;
$route_de
->setLocale('de');
$this->provider
->expects($this
->once())
->method('getRouteByName')
->with($name)
->will($this
->returnValue($route_en));
$this->contentDocument
->expects($this
->once())
->method('getRoutes')
->will($this
->returnValue(array(
$route_en,
$route_de,
)));
$route_en
->expects($this
->once())
->method('getContent')
->will($this
->returnValue($this->contentDocument));
$route_en
->expects($this
->never())
->method('compile');
$route_de
->expects($this
->once())
->method('compile')
->will($this
->returnValue($this->routeCompiled));
$this
->assertEquals('result_url', $this->generator
->generate($name, array(
'_locale' => 'de',
)));
}