Problem/Motivation
PHPUnit 10 (Feb 2023) introduced attributes to replace the annotations that were previously used to indicate test configuration to PHPUnit. PHPUnit 11 is triggering unsilenceable deprecations if it detects tests that use annotations. PHPUnit 12 (Feb 2025) will no longer parse annotations.
Drupal's TestDiscovery class, that builds the tests to be executed by run-tests.sh, mandates tests to use @group
annotations. It fails if only #[Group(...)]
attributes are used.
Proposed resolution
Refactor TestDiscovery to allow usage of #[Group(...)]
attributes, and deprecate code that parses @group
annotations, for removal in the next Drupal's major.
Remaining tasks
User interface changes
nope
API changes
nope
Data model changes
nope
Release notes snippet
Drupal tests now can use PHPUnit's 10 attributes instead of the legacy annotations. New tests MUST use attributes.