Problem/Motivation

There are quite some deprecations reported in unit tests logs when test run under PHP 8.5.

Apart from Drupal code deprecations, lots seems related to PHPUnit and its dependnecies themselves.

Steps to reproduce

Look at PHP 8.5 test jobs in CI

Proposed resolution

Bump PHPUnit to ^11.5.34 with all its dependencies.

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Issue fork drupal-3541427

Command icon 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

mondrake created an issue. See original summary.

mondrake’s picture

Status: Active » Needs review

The remaining failures are due to issues in Prophecy and in PhpDocumentor.

andypost’s picture

Please update https://github.com/Lullabot/php-webdriver/releases/tag/v2.0.7 as well as it makes more tests to pass

andypost’s picture

Pushed one more commit as this upgrade is required

andypost’s picture

Curious if the changes in table clean-up will help to close related #2949229: SQLite findTables Returns Empty Array on External DB.

EDIT sadly no

andypost’s picture

PHP 8.5 changes are backported to 10.x so part of it should do too

mondrake’s picture

Title: Bump PHPUnit to ^11.5.32 with all dependencies for testing with PHP 8.5 » Bump PHPUnit to ^11.5.33 with all dependencies for testing with PHP 8.5
Status: Needs review » Needs work
Related issues: +#3497124: Deprecate expectDeprecation(), use PHPUnit's expectUserDeprecationMessage*() instead

PHPUnit 11.5.33 is out and contains the fix that will allow #3497124: Deprecate expectDeprecation(), use PHPUnit's expectUserDeprecationMessage*() instead to proceed. Let’s bump to that.

andypost’s picture

one more deprecation

    1) /builds/issue/drupal-3541427/vendor/phpspec/prophecy/src/Prophecy/Call/CallCenter.php:87
    Method SplObjectStorage::attach() is deprecated since 8.5, use method SplObjectStorage::offsetSet() instead
    
    Triggered by:
    
    * Drupal\Tests\Core\Entity\EntityUnitTest::testPostSave
      /builds/issue/drupal-3541427/core/tests/Drupal/Tests/Core/Entity/EntityUnitTest.php:411
    
    * Drupal\Tests\Core\Entity\EntityUnitTest::testPostSaveBundle
      /builds/issue/drupal-3541427/core/tests/Drupal/Tests/Core/Entity/EntityUnitTest.php:433
andypost’s picture

andypost’s picture

With sed -i 's/attach/offsetSet/' vendor/phpspec/prophecy/src/Prophecy/Call/CallCenter.php # TODO: wait for release the test pass

andypost’s picture

catch’s picture

Priority: Major » Critical

This is critical for PHP 8.5 support.

mondrake’s picture

Title: Bump PHPUnit to ^11.5.33 with all dependencies for testing with PHP 8.5 » Bump PHPUnit to ^11.5.34 with all dependencies for testing with PHP 8.5
Assigned: Unassigned » mondrake

Working on this to update to PHPUnit 11.5.34 that

Do not configure report_memleaks setting (which will be deprecated in PHP 8.5) for PHPT processes

mondrake’s picture

Status: Needs work » Needs review
Issue tags: +PHP 8.5

Added a job to test kernel/functional/build tests under PHP 8.5, allowing failures for now.

mondrake’s picture

Assigned: mondrake » Unassigned
mondrake’s picture

Issue summary: View changes
andypost’s picture

Would be great to add updated compsoer https://getcomposer.org/changelog/2.8.11 (as it require newer react/promise)

andypost’s picture

andypost’s picture

Last blockers are

- https://github.com/minkphp/MinkBrowserKitDriver/pull/185
- new release of prophecy

mondrake’s picture

Anyone up to RTBC here so at least we cut some of the noise in the logs?

andypost’s picture

as of beta2 new failures

    1) /builds/issue/drupal-3523596/vendor/justinrainbow/json-schema/src/JsonSchema/Uri/Retrievers/FileGetContents.php:57
    The predefined locally scoped $http_response_header variable is deprecated, call http_get_last_response_headers() instead
andypost’s picture

Status: Needs review » Reviewed & tested by the community

I see the rest of new deprecations require own issues so it's good to go as is... at least core will produce less noise in pipelines

  • catch committed 52197ce5 on 11.x
    Issue #3541427 by mondrake, andypost: Bump PHPUnit to ^11.5.34 with all...
catch’s picture

Status: Reviewed & tested by the community » Fixed
Issue tags: +Needs followup

Committed/pushed to 11.x, thanks!

We need to update these dependencies as far as we can on 10.6 in case we're able to support PHP 8.5 there, I guess it will depend whether the upstream dependencies will backport these fixes to earlier branches or whether we end up having to skip some deprecations or shim things.

Since we can't do a direct backport here, tagging for a follow-up.

andypost’s picture

Status: Fixed » Closed (fixed)

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