From 2adf8223aa069b20505d5720b8b2233bf960794e Mon Sep 17 00:00:00 2001 From: catch <catch@35733.no-reply.drupal.org> Date: Tue, 21 Sep 2021 15:44:56 +0100 Subject: [PATCH] Issue #3238210 by daffie: The mocked method in Drupal\Tests\Core\Routing\LazyRouteCollectionTest does not return an ArrayIiterator --- .../Drupal/Tests/Core/Routing/LazyRouteCollectionTest.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/tests/Drupal/Tests/Core/Routing/LazyRouteCollectionTest.php b/core/tests/Drupal/Tests/Core/Routing/LazyRouteCollectionTest.php index 88aa9470433d..162fed6eb2dd 100644 --- a/core/tests/Drupal/Tests/Core/Routing/LazyRouteCollectionTest.php +++ b/core/tests/Drupal/Tests/Core/Routing/LazyRouteCollectionTest.php @@ -35,10 +35,10 @@ class LazyRouteCollectionTest extends UnitTestCase { public function setUp(): void { parent::setUp(); $this->routeProvider = $this->createMock(RouteProviderInterface::class); - $this->testRoutes = [ + $this->testRoutes = new \ArrayIterator([ 'route_1' => new Route('/route-1'), 'route_2' => new Route('/route-2'), - ]; + ]); } /** @@ -51,7 +51,7 @@ public function testGetIterator() { ->with(NULL) ->will($this->returnValue($this->testRoutes)); $lazyRouteCollection = new LazyRouteCollection($this->routeProvider); - $this->assertEquals($this->testRoutes, iterator_to_array($lazyRouteCollection->getIterator())); + $this->assertEquals($this->testRoutes, $lazyRouteCollection->getIterator()); $this->assertEquals($this->testRoutes, $lazyRouteCollection->all()); } -- GitLab