Update to PHPUnit 9.6.13 and replace deprecated assertObject[Not]HasAttribute()

Created on 4 May 2023, over 1 year ago
Updated 3 November 2023, about 1 year ago

Problem/Motivation

Over in 📌 Update composer dependencies for Drupal 10.2 Fixed we've discovered that phpunit/phpunit has backported assertObject[Not]HasProperty() from 10.1.x to the 9.6.x branch.

Let's update to PHPUnit 9.6.13 and replace deprecated assertObject[Not]HasAttribute() with assertObject[Not]HasProperty().

Upon revisit: Let's treat this as we did for the other replacements of deprecated PHPUnit asserts: Replace in core, and treat as deprecation warning so contrib can catch up.

The main difference between the 2 MRs is that 10.1.x doesn't need to remove the deprecations from the PHPStan baseline.

Proposed resolution

- Bump phpunit/phpunit to 9.6.13, also use this version number in the composer.json, because the new baseline of PHPStan won't pass with any lower version.
- Replace deprecated assertObject[Not]HasAttribute() with assertObject[Not]HasProperty().
- Create a new PHPStan baseline (10.2.x+ only).
- Adjust the (slighty) changed deprecation messages in core/tests/Drupal/Tests/Traits/PhpUnitWarnings.php.
- Remove the suppressions from core/.deprecation-ignore.txt.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

📌 Task
Status

Fixed

Version

11.0 🔥

Component
PHPUnit 

Last updated about 20 hours ago

Created by

🇮🇹Italy mondrake 🇮🇹

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024