Problem/Motivation

PHPUnit 10 deprecates use of non-static @dataProvider methods.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Issue fork drupal-3443533

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

longwave created an issue. See original summary.

mondrake’s picture

Issue tags: +PHPUnit 10

longwave’s picture

Status: Active » Needs review

For this one we can store the entity IDs and generate the mocks in the test method where required. Also took the liberty to convert the array format to a generator to make the data provider easier to read.

mondrake’s picture

Can we fully typehint both the providers and the test methods then, we did so in other similar situations

longwave’s picture

Added types everywhere.

mondrake’s picture

Status: Needs review » Needs work
longwave’s picture

Status: Needs work » Needs review

Thanks, addressed, also cleaned up the rest of the method a bit.

mondrake’s picture

Status: Needs review » Reviewed & tested by the community

Looks all good, thanks.

pravesh_poonia’s picture

Applied MR, changes looking fixed now

  • catch committed dd84445a on 11.x
    Issue #3443533 by longwave, mondrake: Change @dataprovider to static in...

  • catch committed be580003 on 10.3.x
    Issue #3443533 by longwave, mondrake: Change @dataprovider to static in...
catch’s picture

Version: 11.x-dev » 10.3.x-dev
Status: Reviewed & tested by the community » Fixed

Committed/pushed to 11.x and cherry-picked to 10.3.x, thanks!

  • catch committed dd84445a on 11.0.x
    Issue #3443533 by longwave, mondrake: Change @dataprovider to static in...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.