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
\Drupal\KernelTests\Core\Routing\RouteProviderTest::testDuplicateRoutePaths()
can cause deprecations on PHP 8.1 due to using current()
on $routes
object which implements \IteratorAggregate
Steps to reproduce
Run core/tests/Drupal/KernelTests/Core/Routing/RouteProviderTest.php
on PHP 8.1
5x: current(): Calling current() on an object is deprecated
5x in RouteProviderTest::testDuplicateRoutePaths from Drupal\KernelTests\Core\Routing
Proposed resolution
Use iterator's (getIterator()
) methods
Remaining tasks
review, commit
User interface changes
no
API changes
no
Data model changes
no
Release notes snippet
no
Comment | File | Size | Author |
---|---|---|---|
#2 | 3240194-2.patch | 878 bytes | andypost |
Comments
Comment #2
andypostpatch from https://git.drupalcode.org/project/drupal/-/merge_requests/937/diffs?com...
Comment #3
daffie CreditAttribution: daffie commentedLooks good to me.
Comment #5
catchCommitted b9944c2 and pushed to 9.3.x. Thanks!