Problem/Motivation
A PHP deprecation notice is triggered by OpenIdConnectSessionTest::testSaveDestinationUserPath():
1 test triggered 1 PHP deprecation:
1) /var/www/html/modules/contrib/openid_connect/src/OpenIDConnectSession.php:102
ltrim(): Passing null to parameter #1 ($string) of type string is deprecated
Triggered by:
* Drupal\Tests\openid_connect\Unit\OpenIdConnectSessionTest::testSaveDestinationUserPath
/var/www/html/modules/contrib/openid_connect/tests/src/Unit/OpenIdConnectSessionTest.php:147
Eventually this will cause an error when the module is tested on PHP 9. It's caused by OpenIDConnectSession::saveDestination() trying to build a URL for the user.login route.
Steps to reproduce
See the most recent max PHP version pipeline: https://git.drupalcode.org/project/openid_connect/-/jobs/3855616.
Proposed resolution
The OpenIdConnectSessionTest::testSaveDestination() test gets around this by mocking the route. A quick fix is to do the same mocking in testSaveDestinationUserPath(). But a more appropriate fix might be to check for the existence of the route in saveDestination() or to simply add the User module as a dependency. I'll submit an MR for the quick fix and leave it up to the maintainers to decide whether they want to bother making the code more robust.
Issue fork openid_connect-3498837
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
dcam commentedThe max-PHP version PHPUnit test comes back green with this MR.
Comment #5
pfrillingLooks good to me. I merged the 3.x branch to confirm the pipeline completes.
Comment #6
pfrillingAll pipelines green! Started the merge train.
Comment #9
joseph.olstadAlpha6 causes an issue in keycloak reported by two others
I'm not sure which change in alpha6 is causing this.
Comment #10
pfrillingRemove unrelated linked issue.