You are here

public function UrlMatcherTest::testDefaultRequirementForOptionalVariables in Zircon Profile 8.0

Same name and namespace in other branches
  1. 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

UrlMatcherTest

Namespace

Symfony\Component\Routing\Tests\Matcher

Code

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'));
}