Skip to content

Tests: Make data providers in tests/phpunit/tests/compat/ public and static - #14396

Closed
rejaulalomkhan wants to merge 1 commit into
WordPress:trunkfrom
rejaulalomkhan:tests/66211-compat-data-providers
Closed

rejaulalomkhan wants to merge 1 commit into
WordPress:trunkfrom
rejaulalomkhan:tests/66211-compat-data-providers

Conversation

@rejaulalomkhan

Copy link
Copy Markdown

Trac ticket: https://core.trac.wordpress.org/ticket/66211

Description

In PHPUnit 10+, data providers must be declared public static. Calling data providers non-statically is deprecated in PHPUnit 10 and will be removed in PHPUnit 11.

This PR converts 18 data providers across 14 files in tests/phpunit/tests/compat/ to public static.

Testing Instructions

  1. Run vendor/bin/phpcs tests/phpunit/tests/compat/
  2. Run vendor/bin/phpunit --group compat

All tests pass cleanly.


Use of AI Tools:
I used Antigravity (Gemini 2.5 Pro) to verify data providers in tests/phpunit/tests/compat/ and run local PHPCS and PHPUnit test suites.

@github-actions

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Core Committers: Use this line as a base for the props when committing in SVN:

Props rejaulalomkhan.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@lancewillett lancewillett left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the provider bodies and callers for static safety; datasets and assertions are preserved. Randomized affected-class runs had no assertion failures: 213 tests on single-site and 213 on multisite (seed 66211). PHPCS and CI pass.

AI review · gpt-6

@lancewillett

Copy link
Copy Markdown
Member

wporg-sync pushed a commit that referenced this pull request Oct 17, 2026
Declare the data providers in `tests/phpunit/tests/compat/` as `public static` for compatibility with newer PHPUnit versions. Preserve their datasets and assertions.

Developed in: #14396

Props rejaulalomkhan.
See #66211.


git-svn-id: https://develop.svn.wordpress.org/trunk@64446 602fd350-edb4-49c9-b593-d223f7449a82
wporg-sync pushed a commit to WordPress/WordPress that referenced this pull request Oct 17, 2026
Declare the data providers in `tests/phpunit/tests/compat/` as `public static` for compatibility with newer PHPUnit versions. Preserve their datasets and assertions.

Developed in: WordPress/wordpress-develop#14396

Props rejaulalomkhan.
See #66211.

Built from https://develop.svn.wordpress.org/trunk@64446


git-svn-id: http://core.svn.wordpress.org/trunk@63596 1a063a9b-81f0-0310-95a4-ce76da25c4cd
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