Skip to content

PHPUnit 9 no longer supported — composer.json constraint is misleading #1850

@alleknalle

Description

@alleknalle

Hi there,

The composer.json lists PHPUnit 9.6.34 as a supported version:

  "phpunit/phpunit": "9.6.34|10.5.63|11.4.4|11.5.50|12.5.14"

However, the test suite uses #[DataProvider] PHP attributes (e.g. ArrayHelperTest.php), which are only available from PHPUnit 10 onwards (PHPUnit\Framework\Attributes\DataProvider). PHPUnit 9 has no knowledge of these attributes — it silently ignores them, causing data-provided test methods to run without their data sets and fail.

Impact

  • Installing with PHPUnit 9 produces a broken test suite
  • Static analysis tools (PHPStan) report Attribute class PHPUnit\Framework\Attributes\DataProvider does not exist when PHPUnit 9 is resolved from the lock file

Suggested fix

Remove 9.6.34 from the version list.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions