[PHPUnit 10] @dataProvider methods must be declared static and public

Created on 10 April 2023, over 1 year ago
Updated 21 March 2024, 4 months ago

Problem/Motivation

In PHPUnit 10, data provider methods that are not declared static yield deprecation errors in PHPUnit runs like

There were 2 PHPUnit deprecations:

1) Drupal\Tests\Core\Entity\EntityFieldManagerTest::testGetBaseFieldDefinitionsTranslatableEntityTypeDefaultLangcode
Data Provider method Drupal\Tests\Core\Entity\EntityFieldManagerTest::providerTestGetBaseFieldDefinitionsTranslatableEntityTypeDefaultLangcode() is not static

/var/www/html/core/tests/Drupal/Tests/Core/Entity/EntityFieldManagerTest.php:345

2) Drupal\Tests\Core\Entity\EntityFieldManagerTest::testGetBaseFieldDefinitionsTranslatableEntityTypeLangcode
Data Provider method Drupal\Tests\Core\Entity\EntityFieldManagerTest::providerTestGetBaseFieldDefinitionsTranslatableEntityTypeLangcode() is not static

/var/www/html/core/tests/Drupal/Tests/Core/Entity/EntityFieldManagerTest.php:382

Proposed resolution

Declare all data provider methods as static.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

๐Ÿ“Œ Task
Status

Fixed

Version

11.0 ๐Ÿ”ฅ

Component
PHPUnitย  โ†’

Last updated 1 minute ago

Created by

๐Ÿ‡ฎ๐Ÿ‡นItaly mondrake ๐Ÿ‡ฎ๐Ÿ‡น

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

Merge Requests

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.69.0 2024