function LazyRouteCollectionTest::testGetIterator

Same name and namespace in other branches
  1. 11.x core/tests/Drupal/Tests/Core/Routing/LazyRouteCollectionTest.php \Drupal\Tests\Core\Routing\LazyRouteCollectionTest::testGetIterator()
  2. 10 core/tests/Drupal/Tests/Core/Routing/LazyRouteCollectionTest.php \Drupal\Tests\Core\Routing\LazyRouteCollectionTest::testGetIterator()
  3. 9 core/tests/Drupal/Tests/Core/Routing/LazyRouteCollectionTest.php \Drupal\Tests\Core\Routing\LazyRouteCollectionTest::testGetIterator()

Tests get iterator.

@legacy-covers ::getIterator @legacy-covers ::all

File

core/tests/Drupal/Tests/Core/Routing/LazyRouteCollectionTest.php, line 54

Class

LazyRouteCollectionTest
Tests Drupal\Core\Routing\LazyRouteCollection.

Namespace

Drupal\Tests\Core\Routing

Code

public function testGetIterator() : void {
  $this->routeProvider
    ->expects($this->exactly(2))
    ->method('getRoutesByNames')
    ->with(NULL)
    ->willReturn($this->testRoutes);
  $lazyRouteCollection = new LazyRouteCollection($this->routeProvider);
  $this->assertEquals($this->testRoutes, (array) $lazyRouteCollection->getIterator());
  $this->assertEquals($this->testRoutes, $lazyRouteCollection->all());
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.