public function UrlMatcherTest::testMatchWithDynamicPrefix

File

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

Class

UrlMatcherTest

Namespace

Symfony\Component\Routing\Tests\Matcher

Code

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