File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -39,7 +39,12 @@ public function count(): int
39
39
*/
40
40
public function all (): array
41
41
{
42
- return $ this ->provider ->getRoutesByNames (null );
42
+ $ routes = $ this ->provider ->getRoutesByNames (null );
43
+ if (\is_array ($ routes )) {
44
+ return $ routes ;
45
+ }
46
+
47
+ return \iterator_to_array ($ routes );
43
48
}
44
49
45
50
public function get (string $ name ): ?Route
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ public function testGetIterator(): void
36
36
$ routeProvider ->expects ($ this ->exactly (2 ))
37
37
->method ('getRoutesByNames ' )
38
38
->with (null )
39
- ->willReturn ($ testRoutes );
39
+ ->willReturn (new \ ArrayIterator ( $ testRoutes) );
40
40
$ lazyRouteCollection = new LazyRouteCollection ($ routeProvider );
41
41
$ this ->assertEquals ($ testRoutes , iterator_to_array ($ lazyRouteCollection ->getIterator ()));
42
42
$ this ->assertEquals ($ testRoutes , $ lazyRouteCollection ->all ());
You can’t perform that action at this time.
0 commit comments