public function RouteCollectionTest::testIterator in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/symfony/routing/Tests/RouteCollectionTest.php \Symfony\Component\Routing\Tests\RouteCollectionTest::testIterator()
File
- vendor/
symfony/ routing/ Tests/ RouteCollectionTest.php, line 57
Class
Namespace
Symfony\Component\Routing\TestsCode
public function testIterator() {
$collection = new RouteCollection();
$collection
->add('foo', new Route('/foo'));
$collection1 = new RouteCollection();
$collection1
->add('bar', $bar = new Route('/bar'));
$collection1
->add('foo', $foo = new Route('/foo-new'));
$collection
->addCollection($collection1);
$collection
->add('last', $last = new Route('/last'));
$this
->assertInstanceOf('\\ArrayIterator', $collection
->getIterator());
$this
->assertSame(array(
'bar' => $bar,
'foo' => $foo,
'last' => $last,
), $collection
->getIterator()
->getArrayCopy());
}