public function UrlMatcherTest::testMatchWithDynamicPrefix

File

drupal/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Matcher/UrlMatcherTest.php, line 142

Class

UrlMatcherTest

Namespace

Symfony\Component\Routing\Tests\Matcher

Code

public function testMatchWithDynamicPrefix() {
  $collection = new RouteCollection();
  $collection
    ->add('foo', new Route('/{foo}'));
  $collection
    ->addPrefix('/b');
  $collection
    ->addPrefix('/{_locale}');
  $matcher = new UrlMatcher($collection, new RequestContext());
  $this
    ->assertEquals(array(
    '_locale' => 'fr',
    '_route' => 'foo',
    'foo' => 'foo',
  ), $matcher
    ->match('/fr/b/foo'));
}