Repository navigation
Tests: Make data providers in tests/phpunit/tests/admin/includes/misc/ public static - #15309
devmuhib009 wants to merge 1 commit into
Conversation
…/ public static. See #66211. Props devmuhib009.
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
|
huzaifaalmesbah
left a comment
There was a problem hiding this comment.
Thanks! No non-static provider is left in admin/includes/misc/ now. LGTM.
AI Review: Opus 5.5
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues block the change to make four data providers static for PHPUnit 10+ compatibility.
No open issues 🎉
What changed in this PR
Prepares the admin miscellaneous tests for PHPUnit 10+ by making four data providers public static, supporting the test-suite modernization tracked in Trac #66211.
Changes:
- Adds
staticto the four provider declarations. - Leaves datasets and test logic unchanged.
| File | Description |
|---|---|
tests/phpunit/tests/admin/includes/misc/wpMakePluginFileTree.php |
Makes the plugin file tree provider static. |
tests/phpunit/tests/admin/includes/misc/iis7RewriteRuleExists.php |
Makes the rewrite-rule existence provider static. |
tests/phpunit/tests/admin/includes/misc/iis7AddRewriteRule.php |
Makes the rewrite-rule addition provider static. |
tests/phpunit/tests/admin/includes/misc/gotModRewrite.php |
Makes the Apache rewrite detection provider static. |
Review effort: Balanced
lancewillett
left a comment
There was a problem hiding this comment.
Reviewed the changed code against the implementation and existing coverage; no blocking issue found.
Validated with the related provider/factory patches on current trunk: 1,108 tests and 2,503 assertions in each of single-site and multisite, randomized seed 1101. The same two environment-dependent skips occurred before and after; no failures or errors.
Current-head CI and Copilot review checked.
AI review · gpt-6
Under Trac ticket #66211 and following committer guidance (Trac #66211 comment 109) to consolidate changes per directory, this PR updates all remaining data provider methods across
tests/phpunit/tests/admin/includes/misc/to bepublic static.Trac ticket: https://core.trac.wordpress.org/ticket/66211
What
Declare data provider methods as
public staticacrosstests/phpunit/tests/admin/includes/misc/:Tests_got_mod_rewrite::data_got_mod_rewrite()intests/phpunit/tests/admin/includes/misc/gotModRewrite.phpTests_iis7_add_rewrite_rule::data_iis7_add_rewrite_rule()intests/phpunit/tests/admin/includes/misc/iis7AddRewriteRule.phpTests_iis7_rewrite_rule_exists::data_iis7_rewrite_rule_exists()intests/phpunit/tests/admin/includes/misc/iis7RewriteRuleExists.phpTests_wp_make_plugin_file_tree::data_wp_make_plugin_file_tree()intests/phpunit/tests/admin/includes/misc/wpMakePluginFileTree.phpWhy
PHPUnit 10+ requires data providers to be
public static. These methods do not use$thisand return static datasets, so declaring thempublic staticprepares the test suite for modern PHPUnit versions without changing test behavior.Testing Instructions
Run the test suite and coding standards check:
All tests pass cleanly.