You are here

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

File

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

Class

RouteCollectionTest

Namespace

Symfony\Component\Routing\Tests

Code

public function testRemove() {
  $collection = new RouteCollection();
  $collection
    ->add('foo', $foo = new Route('/foo'));
  $collection1 = new RouteCollection();
  $collection1
    ->add('bar', $bar = new Route('/bar'));
  $collection
    ->addCollection($collection1);
  $collection
    ->add('last', $last = new Route('/last'));
  $collection
    ->remove('foo');
  $this
    ->assertSame(array(
    'bar' => $bar,
    'last' => $last,
  ), $collection
    ->all(), '->remove() can remove a single route');
  $collection
    ->remove(array(
    'bar',
    'last',
  ));
  $this
    ->assertSame(array(), $collection
    ->all(), '->remove() accepts an array and can remove multiple routes at once');
}