You are here

public function RouteCollectionTest::testClone 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::testClone()

File

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

Class

RouteCollectionTest

Namespace

Symfony\Component\Routing\Tests

Code

public function testClone() {
  $collection = new RouteCollection();
  $collection
    ->add('a', new Route('/a'));
  $collection
    ->add('b', new Route('/b', array(
    'placeholder' => 'default',
  ), array(
    'placeholder' => '.+',
  )));
  $clonedCollection = clone $collection;
  $this
    ->assertCount(2, $clonedCollection);
  $this
    ->assertEquals($collection
    ->get('a'), $clonedCollection
    ->get('a'));
  $this
    ->assertNotSame($collection
    ->get('a'), $clonedCollection
    ->get('a'));
  $this
    ->assertEquals($collection
    ->get('b'), $clonedCollection
    ->get('b'));
  $this
    ->assertNotSame($collection
    ->get('b'), $clonedCollection
    ->get('b'));
}