You are here

public function RouteCollectionTest::testDeepOverriddenRoute in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/routing/Tests/RouteCollectionTest.php \Symfony\Component\Routing\Tests\RouteCollectionTest::testDeepOverriddenRoute()

File

vendor/symfony/routing/Tests/RouteCollectionTest.php, line 39

Class

RouteCollectionTest

Namespace

Symfony\Component\Routing\Tests

Code

public function testDeepOverriddenRoute() {
  $collection = new RouteCollection();
  $collection
    ->add('foo', new Route('/foo'));
  $collection1 = new RouteCollection();
  $collection1
    ->add('foo', new Route('/foo1'));
  $collection2 = new RouteCollection();
  $collection2
    ->add('foo', new Route('/foo2'));
  $collection1
    ->addCollection($collection2);
  $collection
    ->addCollection($collection1);
  $this
    ->assertEquals('/foo2', $collection1
    ->get('foo')
    ->getPath());
  $this
    ->assertEquals('/foo2', $collection
    ->get('foo')
    ->getPath());
}