Skip to content

Fix calls to deprecated version of PHPUnit providers#990

Merged
tarrow merged 1 commit into
mainfrom
fixPHPUnitDeprecations
Nov 5, 2025
Merged

Fix calls to deprecated version of PHPUnit providers#990
tarrow merged 1 commit into
mainfrom
fixPHPUnitDeprecations

Conversation

@tarrow
Copy link
Copy Markdown
Contributor

@tarrow tarrow commented Nov 4, 2025

All PHPUnit Providers now need to be static and public[1].

This commit fixes the references to these in what I believe was the simplest way possible. In ElasticSearchIndexInitTest this meant it was necessary to move some mocking out of the provider and into the test directly.

I investigated creating mocks statically; I discovered mock() which creates a Mockery mock but I decided that making the decision to move to a different mock library wasn't what I wanted to do here. I just wanted my tests to run without deprecation warnings.

[1] sebastianbergmann/phpunit@9caafe2

All PHPUnit Providers now need to be static and public[1].

This commit fixes the references to these in what I believe
was the simplest way possible. In ElasticSearchIndexInitTest
this meant it was necessary to move some mocking out of
the provider and into the test directly.

I investigated creating mocks statically; I discovered `mock()`
which creates a Mockery mock but I decided that making the
decision to move to a different mock library wasn't what I wanted
to do here. I just wanted my tests to run without deprecation
warnings.

[1] sebastianbergmann/phpunit@9caafe2
@tarrow tarrow requested review from dati18 and deer-wmde November 4, 2025 18:24
@tarrow tarrow merged commit ca359b5 into main Nov 5, 2025
6 checks passed
@tarrow tarrow deleted the fixPHPUnitDeprecations branch November 5, 2025 09:20
deer-wmde pushed a commit that referenced this pull request Dec 15, 2025
All PHPUnit Providers now need to be static and public[1].

This commit fixes the references to these in what I believe
was the simplest way possible. In ElasticSearchIndexInitTest
this meant it was necessary to move some mocking out of
the provider and into the test directly.

I investigated creating mocks statically; I discovered `mock()`
which creates a Mockery mock but I decided that making the
decision to move to a different mock library wasn't what I wanted
to do here. I just wanted my tests to run without deprecation
warnings.

[1] sebastianbergmann/phpunit@9caafe2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants