public function UrlGeneratorTest::testAdjacentVariables in Zircon Profile 8.0
Same name and namespace in other branches
- 8 vendor/symfony/routing/Tests/Generator/UrlGeneratorTest.php \Symfony\Component\Routing\Tests\Generator\UrlGeneratorTest::testAdjacentVariables()
File
- vendor/symfony/routing/Tests/Generator/UrlGeneratorTest.php, line 340
Class
- UrlGeneratorTest
Namespace
Symfony\Component\Routing\Tests\Generator
Code
public function testAdjacentVariables() {
$routes = $this
->getRoutes('test', new Route('/{x}{y}{z}.{_format}', array(
'z' => 'default-z',
'_format' => 'html',
), array(
'y' => '\\d+',
)));
$generator = $this
->getGenerator($routes);
$this
->assertSame('/app.php/foo123', $generator
->generate('test', array(
'x' => 'foo',
'y' => '123',
)));
$this
->assertSame('/app.php/foo123bar.xml', $generator
->generate('test', array(
'x' => 'foo',
'y' => '123',
'z' => 'bar',
'_format' => 'xml',
)));
$this
->setExpectedException('Symfony\\Component\\Routing\\Exception\\InvalidParameterException');
$generator
->generate('test', array(
'x' => 'do.t',
'y' => '123',
'z' => 'bar',
'_format' => 'xml',
));
}