public function UrlMatcherTest::testDefaultRequirementForOptionalVariables in Zircon Profile 8.0
Same name and namespace in other branches
- 8 vendor/symfony/routing/Tests/Matcher/UrlMatcherTest.php \Symfony\Component\Routing\Tests\Matcher\UrlMatcherTest::testDefaultRequirementForOptionalVariables()
File
- vendor/
symfony/ routing/ Tests/ Matcher/ UrlMatcherTest.php, line 220
Class
Namespace
Symfony\Component\Routing\Tests\MatcherCode
public function testDefaultRequirementForOptionalVariables() {
$coll = new RouteCollection();
$coll
->add('test', new Route('/{page}.{_format}', array(
'page' => 'index',
'_format' => 'html',
)));
$matcher = new UrlMatcher($coll, new RequestContext());
$this
->assertEquals(array(
'page' => 'my-page',
'_format' => 'xml',
'_route' => 'test',
), $matcher
->match('/my-page.xml'));
}