Skip to content

Issue #3550150: Fix failing tests over PHPUnit 10.

PHPUnit 10+ (used in Drupal 11) requires data provider array keys to exactly match test method parameter names when using named arrays. This breaks tests that work fine with PHPUnit 9 (Drupal 10).

Error in PHPUnit 11: PHPUnit\Event\Code\TestMethod::__construct(): Argument #4 ($testData) must be of type PHPUnit\Metadata\TestData\TestData

Data providers used named keys like 'expected_title' and 'expected_caption', but test methods had parameters named $expected. PHPUnit 10+ enforces strict matching, while PHPUnit 9 used positional matching as fallback.

Closes #3550150

Merge request reports

Loading