public function UrlMatcherTest::testAdjacentVariables in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/symfony/routing/Tests/Matcher/UrlMatcherTest.php \Symfony\Component\Routing\Tests\Matcher\UrlMatcherTest::testAdjacentVariables()
File
- vendor/symfony/routing/Tests/Matcher/UrlMatcherTest.php, line 238
Class
- UrlMatcherTest
Namespace
Symfony\Component\Routing\Tests\Matcher
Code
public function testAdjacentVariables() {
$coll = new RouteCollection();
$coll
->add('test', new Route('/{w}{x}{y}{z}.{_format}', array(
'z' => 'default-z',
'_format' => 'html',
), array(
'y' => 'y|Y',
)));
$matcher = new UrlMatcher($coll, new RequestContext());
$this
->assertEquals(array(
'w' => 'wwwww',
'x' => 'x',
'y' => 'Y',
'z' => 'Z',
'_format' => 'xml',
'_route' => 'test',
), $matcher
->match('/wwwwwxYZ.xml'));
$this
->assertEquals(array(
'w' => 'wwwww',
'x' => 'x',
'y' => 'y',
'z' => 'ZZZ',
'_format' => 'html',
'_route' => 'test',
), $matcher
->match('/wwwwwxyZZZ'));
$this
->assertEquals(array(
'w' => 'wwwww',
'x' => 'x',
'y' => 'y',
'z' => 'default-z',
'_format' => 'html',
'_route' => 'test',
), $matcher
->match('/wwwwwxy'));
$this
->setExpectedException('Symfony\\Component\\Routing\\Exception\\ResourceNotFoundException');
$matcher
->match('/wxy.html');
}