public function UrlMatcherTest::testMatchOverriddenRoute

File

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

Class

UrlMatcherTest

Namespace

Symfony\Component\Routing\Tests\Matcher

Code

public function testMatchOverriddenRoute() {
  $collection = new RouteCollection();
  $collection
    ->add('foo', new Route('/foo'));
  $collection1 = new RouteCollection();
  $collection1
    ->add('foo', new Route('/foo1'));
  $collection
    ->addCollection($collection1);
  $matcher = new UrlMatcher($collection, new RequestContext());
  $this
    ->assertEquals(array(
    '_route' => 'foo',
  ), $matcher
    ->match('/foo1'));
  $this
    ->setExpectedException('Symfony\\Component\\Routing\\Exception\\ResourceNotFoundException');
  $this
    ->assertEquals(array(), $matcher
    ->match('/foo'));
}