Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment | File | Size | Author |
---|---|---|---|
#5 | 3259675-4.patch | 1.15 KB | hmendes |
|
Comments
Comment #2
longwaveI 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.
Comment #3
daffie CreditAttribution: daffie commentedComment #4
hmendes CreditAttribution: hmendes at CI&T commentedRerolling patch.
Comment #5
hmendes CreditAttribution: hmendes at CI&T commentedSorry, wrong patch :/
Comment #6
daffie CreditAttribution: daffie commentedLooks good to me.
Comment #8
catchCommitted ca3ce56 and pushed to 10.0.x. Thanks!