Update dataProvider Methods to static for PHPUnit 10 Compatibility

Created on 22 July 2024, 8 months ago
Updated 13 August 2024, 7 months ago

Problem/Motivation

We need to ensure all PHPUnit tests are compatible with PHPUnit 10 by updating all dataProvider methods to be static. This is a mandatory requirement for running tests in Drupal 11, as non-static dataProvider methods will cause PHPUnit deprecation warnings and potential test failures.

Change Record: Changes required for PHPUnit 10 compatibility →
Issue: 📌 [PHPUnit 10] @dataProvider methods must be declared static and public Fixed

Steps to reproduce

Run the PHPUnit tests on Drupal 11 and you would see test failure with showing deprecation warnings.

Proposed resolution

  • Locate all dataProvider methods within tests directory. A dataProvider method is usually annotated with @dataProvider in the test methods.
  • Convert each dataProvider
📌 Task
Status

Fixed

Version

2.0

Component

Code

Created by

🇮🇳India vishalkhode

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024