Problem/Motivation

In #3161889: [META] Symfony 6 compatibility once Symfony 6 is installed, some tests fail with

1) Drupal\Tests\Core\Routing\LazyRouteCollectionTest::testGetIterator
TypeError: Drupal\Core\Routing\LazyRouteCollection::all(): Return value must be of type array, ArrayIterator returned

Symfony has added a return type of array to Symfony\Component\Routing\RouteCollection::all(), but our lazy route collection test wants to provide an iterator instead.

Steps to reproduce

Proposed resolution

Change the test to use an array instead of an iterator.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

longwave created an issue. See original summary.

longwave’s picture

Issue summary: View changes
Status: Active » Needs review
FileSize
1.15 KB

I was wrong with the initial analysis. As far as I can see, LazyRouteCollection conforms to the interface and LazyRouteCollectionTest is at fault - forcing all() to return an ArrayIterator which contradicts the interface.

The attached patch converts the test to use arrays instead of ArrayIterators.

daffie’s picture

Status: Needs review » Needs work
Issue tags: +Needs reroll
hmendes’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
FileSize
5.26 KB

Rerolling patch.

hmendes’s picture

FileSize
1.15 KB

Sorry, wrong patch :/

daffie’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me.

  • catch committed ca3ce56 on 10.0.x
    Issue #3259675 by hmendes, longwave: [Symfony 6] Drupal\Core\Routing\...
catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed ca3ce56 and pushed to 10.0.x. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.