Opened 7 weeks ago
Last modified 5 days ago
#66211 accepted task (blessed)
Tests: Make PHPUnit data providers public and static
| Reported by: | lancewillett | Owned by: | lancewillett |
|---|---|---|---|
| Priority: | normal | Milestone: | 7.2 |
| Component: | Build/Test Tools | Version: | |
| Severity: | normal | Keywords: | good-first-bug has-patch has-unit-tests |
| Cc: | Focuses: | tests |
Description
Split from #62004.
PHPUnit 10 deprecated data providers that are not public and static, and PHPUnit 11 removed support for them. On trunk, about 960 of 1,140 data provider methods are not static, across the 512 files that use @dataProvider.
Most need only the static keyword. A provider that uses $this needs a small rework. PHPUnit 9 accepts static providers, so this can land now.
To keep reviews small, please send one PR per directory, and comment here with the directory you're taking.
Change History (328)
This ticket was mentioned in PR #13827 on WordPress/wordpress-develop by @irozum.
7 weeks ago
#1
- Keywords has-patch has-unit-tests added; needs-patch removed
@lancewillett commented on PR #13827:
7 weeks ago
#3
Thanks @irozum
PR #13827 landed in https://core.trac.wordpress.org/changeset/64010
This ticket was mentioned in PR #13956 on WordPress/wordpress-develop by @therssoftware.
6 weeks ago
#4
Makes the 14 PHPUnit data provider methods in tests/phpunit/tests/option/ public static, as part of the PHPUnit 10+ migration (#62004). PHPUnit 10 deprecated non-static data providers and PHPUnit 11 removed support for them. PHPUnit 9 accepts static providers, so this can land now.
None of the providers use $this or the factory, so only the method signatures change. Behavior stays the same.
Files changed:
multisite.php:data_illegal_names,data_email_domainsnetworkOption.php:data_network_id_parameteroption.php:data_bad_option_names,data_valid_but_undesired_option_names,data_option_autoloading,data_option_autoloading_large_option,data_get_option_does_not_hit_the_external_cache_multiple_times_for_the_same_optionsanitizeOption.php:data_sanitize_option,data_sanitize_option_upload_path,data_sanitize_option_permalink_structurethemeMods.php:data_theme_mod_default_value_with_percent_symbolswpDetermineOptionAutoloadValue.php:data_valueswpPrimeOptionCaches.php:data_option_types
Testing:
vendor/bin/phpcs tests/phpunit/tests/option/: no issues.- Ran each affected test class on both single site and multisite (
-c tests/phpunit/multisite.xml). Everything passed.
Trac ticket: https://core.trac.wordpress.org/ticket/66211
Use of AI Tools
AI assistance: Yes
Tool(s): Antigravity
Used for: Finding and updating the provider signatures, and running the tests. Reviewed by robelsust.
#5
@
6 weeks ago
I'm taking tests/phpunit/tests/option/. PR: https://github.com/WordPress/wordpress-develop/pull/13956
All 14 data providers in this directory are now public static. None of them used $this, so only the method signatures change. PHPCS is clean, and the affected test classes pass on both single site and multisite.
#6
@
6 weeks ago
I'm taking tests/phpunit/tests/hooks/. It has four data providers (two in doAction.php and two in applyFilters.php), and none of them use $this. I'll link the PR here.
This ticket was mentioned in PR #13967 on WordPress/wordpress-develop by @pablodiloreto.
6 weeks ago
#7
Makes the four PHPUnit data providers in tests/phpunit/tests/hooks/ public static, as part of the PHPUnit 10+ migration (#62004). None of them use $this, so only the method signatures change.
Files changed:
applyFilters.php:data_priority_callback_order_with_integers,data_priority_callback_order_with_unhappy_path_nonintegersdoAction.php:data_priority_callback_order_with_integers,data_priority_callback_order_with_unhappy_path_nonintegers
Testing:
vendor/bin/phpunit --group hooks, single site and multisite: 168 tests, 450 assertions, same result before and after the change.- The 8 warnings in that run are already on trunk: the "float" data sets use
expectDeprecation(), which PHPUnit 9 flags as going away in PHPUnit 10. This PR doesn't change them. vendor/bin/phpcson both files: no issues.
Use of AI Tools
AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5
Used for: Picking the directory, making the change, running the tests, and drafting this description. I reviewed the diff and the test output.
Opened from the WordPress Contributor Toolkit.
#8
@
6 weeks ago
PR: https://github.com/WordPress/wordpress-develop/pull/13967
The four providers are now public static. The hooks group passes on single site and multisite, with the same results as before the change.
@lancewillett commented on PR #13967:
6 weeks ago
#10
PR #13967 landed in https://core.trac.wordpress.org/changeset/64081
@lancewillett commented on PR #13967:
6 weeks ago
#11
Thanks, Pablo—and congratulations on your first contribution to WordPress Core! 🎉
#12
@
6 weeks ago
I scanned tests/phpunit for every method referenced by a @dataProvider annotation or #[DataProvider] attribute and checked how each one is declared.
Findings
- 1,005 data providers in 439 files are declared
public functioninstead ofpublic static function. - All of them are already
public, so most need only thestatickeyword added. - 42 of them reference
$this, so they need a small refactor first (e.g.self::, static fixtures, or moving the setup into the test method). - Around 220 providers are already
public static.
Breakdown by area (top 12)
| Area | Count | Area | Count |
|---|---|---|---|
| formatting | 103 | multisite | 34 |
| rest-api | 101 | post | 32 |
| functions | 80 | theme | 28 |
| admin | 57 | dependencies | 26 |
| block-supports | 42 | media.php | 23 |
| kses.php | 22 | term | 20 |
The remaining ~80 directories/files each have between 1 and 19.
Providers that use $this
abilities-api/wpAbility.php:data_execute_callbackadmin/includesPlugin.php:data_submenu_positionblocks/render.php,blocks/wpBlockParser.phpdb/charset.php(5 providers)dependencies/scripts.phpformatting/emoji.php,formatting/wpTexturize.php(3)functions/wpTimezoneOverrideOffset.phpgeneral/feedLinksExtra.phpimage/functions.php(7)interactivity-api/wpInteractivityAPI-wp-bind.php(2)kses.php,media.php,template.php,theme.phppost/getPost.php,post/wpInsertPost.php(4)rest-api/rest-post-meta-fields.php,rest-api/rest-term-meta-fields.php,rest-api/wpRestAbilitiesV1RunController.phpterm/getTermLink.phpuser.php,user/capabilities.php(3)
Proposed approach
To keep the changes easy to review, I'd suggest one PR per test area (e.g. formatting, rest-api, functions, ...). Each PR would add static to the providers that only need the keyword, and the providers that use $this would be handled in separate, focused PRs.
Moving this to 7.2 make sense.
This ticket was mentioned in PR #13975 on WordPress/wordpress-develop by @huzaifaalmesbah.
6 weeks ago
#13
Description
Makes the PHPUnit data provider methods in tests/phpunit/tests/abilities-api/ public static, as part of the PHPUnit 10+ migration (#62004).
PHPUnit 10 deprecated non-static data providers and PHPUnit 11 removed support for them. PHPUnit 9 accepts static providers, so this can land now.
Files changed:
tests/phpunit/tests/abilities-api/wpAbilityCategoryRegistry.php:data_valid_slug_provider(): Madepublic static.data_invalid_slug_provider(): Madepublic static.
tests/phpunit/tests/abilities-api/wpAbility.php:data_execute_input(): Madepublic static.data_validate_input_top_level_required(): Madepublic static.data_execute_callback(): Madepublic static. The 'object method' test case now uses an anonymous class instance with the callback method instead of$this.
Note: wpAbilitiesRegistry.php's data provider (data_invalid_category_types) is already declared public static.
Testing Instructions
# Single site suite npm run test:php -- --test-suffix .php tests/phpunit/tests/abilities-api/ # Multisite suite npm run test:php -- -c tests/phpunit/multisite.xml --test-suffix .php tests/phpunit/tests/abilities-api/ # Code style check composer run lint tests/phpunit/tests/abilities-api/wpAbility.php tests/phpunit/tests/abilities-api/wpAbilityCategoryRegistry.php
Expected result: 226 tests, 538 assertions (OK, 100% pass), 0 lint errors.
Use of AI Tools
AI assistance: Yes
Tool(s): Antigravity
Model(s): Gemini
Used for: Updating data provider signatures and testing. Implementation and test verification were reviewed and executed locally.
@mukesh27 commented on PR #13975:
6 weeks ago
#14
@huzaifaalmesbah Thanks for the PR!
Since the ticket is marked good-first-bug, it's intended for new contributors. As you're an experienced contributor, please avoid picking up good-first-bug tickets in the future so we can use them to help onboard and support new contributors.
Thanks for understanding!
@huzaifaalmesbah commented on PR #13975:
6 weeks ago
#15
Sorry about that, Mukesh. I mainly picked this up to show a few new contributors the PR process. I’ll keep this in mind going forward. Thanks!
@lancewillett commented on PR #13956:
6 weeks ago
#17
PR #13956 landed in https://core.trac.wordpress.org/changeset/64087
@lancewillett commented on PR #13975:
6 weeks ago
#19
PR #13975 landed in https://core.trac.wordpress.org/changeset/64088
This ticket was mentioned in PR #14003 on WordPress/wordpress-develop by @therssoftware.
6 weeks ago
#20
Makes the 28 PHPUnit data provider methods in tests/phpunit/tests/theme/ public static, as part of the PHPUnit 10+ migration (#62004). PHPUnit 10 deprecated non-static data providers and PHPUnit 11 removed support for them. PHPUnit 9 accepts static providers, so this can land now.
None of the providers use $this or the factory, so only the method signatures change. Behavior stays the same.
Files changed:
customHeader.php:data_filter_header_imagewpAddGlobalStylesForBlocks.php:data_wp_get_block_name_from_theme_json_pathwpGetGlobalStylesheet.php:data_should_conditionally_include_font_sizes,data_should_not_conditionally_include_font_sizeswpTheme.php:data_is_block_theme,data_get_file_pathwpThemeGetBlockPatterns.php:data_get_block_patternswpThemeHasThemeJson.php:data_theme_has_theme_json_reports_correctlywpThemeJson.php:data_get_property_value_should_return_string_for_invalid_paths_or_null_valuesdata_sanitize_for_block_with_style_variationsdata_sanitize_with_invalid_style_variationdata_get_styles_for_block_with_style_variationsdata_set_spacing_sizesdata_set_spacing_sizes_when_invaliddata_update_separator_declarationsdata_update_button_width_declarationsdata_custom_css_for_user_capsdata_process_blocks_custom_cssdata_get_block_style_variation_selectordata_append_to_selectordata_prepend_to_selector
wpThemeJsonResolver.php:data_has_same_registered_blocks_when_all_blocks_not_cacheddata_has_same_registered_blocks_when_all_blocks_are_cacheddata_get_core_datadata_get_merged_data_returns_origindata_get_style_variations
wpThemeJsonSelectorList.php:data_split_selector_list,data_prepend_to_selector_uses_safe_splitting
Testing:
vendor/bin/phpcs tests/phpunit/tests/theme/: passed with 0 errors and 0 warnings across all 11 files.- Ran all affected test classes on both single site and multisite (
-c tests/phpunit/multisite.xml). Everything passed cleanly (399 tests across single site / multisite runs).
Trac ticket: https://core.trac.wordpress.org/ticket/66211
Use of AI Tools
AI assistance: Yes
Tool(s): Antigravity
Model(s): Gemini
Used for: Identifying data provider signatures, updating method declarations to public static, and verifying tests across single site and multisite configurations. Implementation and test verification were reviewed and executed locally by robelsust.
#21
follow-up:
↓ 22
@
6 weeks ago
I'm taking tests/phpunit/tests/theme/. PR: https://github.com/WordPress/wordpress-develop/pull/XXXXX
All 28 data providers across the 9 files in this directory are now public static. None of them used $this, so only the method signatures change. PHPCS is clean (0 errors/warnings), and all affected test classes pass on both single site and multisite configurations.
#22
in reply to: ↑ 21
@
6 weeks ago
Replying to therssoftware:
I'm taking
tests/phpunit/tests/theme/. PR: https://github.com/WordPress/wordpress-develop/pull/XXXXX
Feel like AI draft this reply. Make sure to add the proper PR link.
@mukesh27 commented on PR #14003:
6 weeks ago
#23
@lancewillett This one is ready for commit.
@lancewillett commented on PR #14003:
6 weeks ago
#25
PR #14003 landed in https://core.trac.wordpress.org/changeset/64104
This ticket was mentioned in PR #14028 on WordPress/wordpress-develop by @therssoftware.
6 weeks ago
#26
Makes the 5 PHPUnit data provider methods in tests/phpunit/tests/cron/ and tests/phpunit/tests/cron.php public static, as part of the PHPUnit 10+ migration (#62004). PHPUnit 10 deprecated non-static data providers and PHPUnit 11 removed support for them. PHPUnit 9 accepts static providers, so this can land now.
None of the providers use $this or the factory, so only the method signatures change. Behavior stays the same.
Files changed:
tests/phpunit/tests/cron.php:data_wp_reschedule_event_works_with_args
tests/phpunit/tests/cron/getCronArray.php:data_get_cron_array_output_validation
tests/phpunit/tests/cron/setCronArray.php:data_set_cron_array_input_validationdata_set_cron_array_returns_false_when_not_updateddata_set_cron_array_returns_WP_Error_when_not_updated
Testing:
vendor/bin/phpcs: passed with 0 errors and 0 warnings across all 3 files.- Ran all affected test classes on both single site and multisite (
-c tests/phpunit/multisite.xml). Everything passed cleanly (52 tests, 193 assertions across both runs).
Trac ticket: https://core.trac.wordpress.org/ticket/66211
Use of AI Tools
AI assistance: Yes
Tool(s): Antigravity
Model(s): Gemini
Used for: Identifying data provider signatures in the cron tests, updating method declarations to public static, and verifying tests across single site and multisite configurations. Implementation and test verification were reviewed and executed locally by robelsust.
#27
@
6 weeks ago
I'm taking tests/phpunit/tests/cron/ and tests/phpunit/tests/cron.php. PR: https://github.com/WordPress/wordpress-develop/pull/14028
All 5 data providers across the 3 cron test files are now public static. None of them used $this, so only the method signatures change. PHPCS is clean (0 errors/warnings), and all affected test classes pass on both single site and multisite configurations.
@lancewillett commented on PR #14028:
5 weeks ago
#30
PR #14028 landed in https://core.trac.wordpress.org/changeset/64262
This ticket was mentioned in PR #14381 on WordPress/wordpress-develop by @rejaulalomkhan.
4 weeks ago
#31
Makes the 104 PHPUnit data provider methods across 42 files in tests/phpunit/tests/formatting/ public static, as part of the PHPUnit 10+ migration (#62004). PHPUnit 10 deprecated non-static data providers and PHPUnit 11 removed support for them. PHPUnit 9 accepts static providers, so this can land now.
For Tests_Formatting_Emoji, png_cdn and svg_cdn properties were updated to private static so data_wp_staticize_emoji() no longer relies on $this. All other data providers return pure static test data arrays. All datasets and assertions remain unchanged.
Testing:
vendor/bin/phpcs: passed with 0 errors and 0 warnings across all modified files.- Ran test suite on single site: 2,175 tests, 1,118,488 assertions passed cleanly.
- Ran test suite on multisite (
-c tests/phpunit/multisite.xml): 2,175 tests, 1,118,488 assertions passed cleanly.
Use of AI Tools
AI assistance: Yes
Tool(s): Antigravity
Model(s): Gemini 3.8 Flash
Used for: Scanning data provider signatures across formatting test files, identifying static dependencies, and verifying test passes on single site and multisite configurations. Implementation and test verification were reviewed and executed locally by rejaulalomkhan.
This ticket was mentioned in PR #14382 on WordPress/wordpress-develop by @rejaulalomkhan.
4 weeks ago
#32
Makes the 80 PHPUnit data provider methods across 51 files in tests/phpunit/tests/functions/ public static, as part of the PHPUnit 10+ migration (#62004). PHPUnit 10 deprecated non-static data providers and PHPUnit 11 removed support for them. PHPUnit 9 accepts static providers, so this can land now.
In Tests_Functions_wpTimezoneOverrideOffset, the helper method is_timezone_in_dst() was declared private static so data_wp_timezone_override_offset() no longer relies on $this. All other data providers return static test data arrays. All datasets and assertions remain unchanged.
Testing:
vendor/bin/phpcs: passed with 0 errors and 0 warnings across all modified files.- Ran test suite on single site: 1,266 tests, 2,568 assertions passed cleanly.
- Ran test suite on multisite (
-c tests/phpunit/multisite.xml): 1,264 tests, 2,573 assertions passed cleanly.
Use of AI Tools
AI assistance: Yes
Tool(s): Antigravity
Model(s): Gemini 3.8 Flash
Used for: Identifying data provider signatures across functions test files, refactoring helper method in wpTimezoneOverrideOffset.php to static, and running PHPCS and PHPUnit test verification across single site and multisite. Implementation and verification were reviewed and executed locally by rejaulalomkhan.
This ticket was mentioned in PR #14389 on WordPress/wordpress-develop by @rejaulalomkhan.
4 weeks ago
#33
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 58 data providers across 33 files in tests/phpunit/tests/admin/ to public static. It also refactors the submenus_to_add() helper method in includesPlugin.php to private static so it can be called safely within data_submenu_position().
Testing Instructions
- Run
vendor/bin/phpcs tests/phpunit/tests/admin/ - Run
vendor/bin/phpunit --group admin - Run
vendor/bin/phpunit -c tests/phpunit/multisite.xml --group admin
All 1,253 tests on single site and 1,273 tests on multisite pass cleanly without regressions.
---
Use of AI Tools:
I used Antigravity (Gemini 2.5 Pro) to identify data provider methods across tests/phpunit/tests/admin/, refactor helper dependencies, and run local PHPCS and PHPUnit suites to guarantee clean execution.
This ticket was mentioned in PR #14391 on WordPress/wordpress-develop by @rejaulalomkhan.
4 weeks ago
#34
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 data providers in tests/phpunit/tests/bookmark/ to public static.
Testing Instructions
- Run
vendor/bin/phpcs tests/phpunit/tests/bookmark/ - Run
vendor/bin/phpunit --group bookmark
All 108 tests pass cleanly.
---
Use of AI Tools:
I used Antigravity (Gemini 2.5 Pro) to verify data providers in tests/phpunit/tests/bookmark/ and run local PHPCS and PHPUnit test suites.
This ticket was mentioned in PR #14392 on WordPress/wordpress-develop by @rejaulalomkhan.
4 weeks ago
#35
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 7 data providers across 5 files in tests/phpunit/tests/sitemaps/ to public static.
Testing Instructions
- Run
vendor/bin/phpcs tests/phpunit/tests/sitemaps/ - Run
vendor/bin/phpunit --group sitemaps
All 220 tests pass cleanly.
---
Use of AI Tools:
I used Antigravity (Gemini 2.5 Pro) to verify data providers in tests/phpunit/tests/sitemaps/ and run local PHPCS and PHPUnit test suites.
This ticket was mentioned in PR #14393 on WordPress/wordpress-develop by @rejaulalomkhan.
4 weeks ago
#36
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 12 data providers across 11 files in tests/phpunit/tests/comment/ to public static.
Testing Instructions
- Run
vendor/bin/phpcs tests/phpunit/tests/comment/ - Run
vendor/bin/phpunit --group comment
All 693 tests pass cleanly.
---
Use of AI Tools:
I used Antigravity (Gemini 2.5 Pro) to verify data providers in tests/phpunit/tests/comment/ and run local PHPCS and PHPUnit test suites.
This ticket was mentioned in PR #14395 on WordPress/wordpress-develop by @rejaulalomkhan.
4 weeks ago
#37
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 21 data providers across 10 files in tests/phpunit/tests/term/ to public static.
Testing Instructions
- Run
vendor/bin/phpcs tests/phpunit/tests/term/ - Run
vendor/bin/phpunit --group term
All tests pass cleanly.
---
Use of AI Tools:
I used Antigravity (Gemini 2.5 Pro) to verify data providers in tests/phpunit/tests/term/ and run local PHPCS and PHPUnit test suites.
This ticket was mentioned in PR #14396 on WordPress/wordpress-develop by @rejaulalomkhan.
4 weeks ago
#38
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
- Run
vendor/bin/phpcs tests/phpunit/tests/compat/ - 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.
This ticket was mentioned in PR #14397 on WordPress/wordpress-develop by @rejaulalomkhan.
4 weeks ago
#39
Description
In PHPUnit 10+, data provider methods must be public and static. In preparation for upgrading the test suite to PHPUnit 10 and beyond, data provider methods in the WordPress Core test suite are being converted to public static.
This PR updates all data provider methods across tests/phpunit/tests/date/ to be public static:
- Makes 11 data provider methods
public staticacross 8 test files.
---
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests in the Core Handbook for more details.
Use of AI Tools
This refactoring was identified and verified using Antigravity with Claude 3.7 Sonnet. All unit tests were executed and verified locally with PHPUnit.
This ticket was mentioned in PR #14398 on WordPress/wordpress-develop by @rejaulalomkhan.
4 weeks ago
#40
Description
In PHPUnit 10+, data provider methods must be public and static. In preparation for upgrading the test suite to PHPUnit 10 and beyond, data provider methods in the WordPress Core test suite are being converted to public static.
This PR updates all data provider methods across tests/phpunit/tests/block-supports/ to be public static:
- Makes 44 data provider methods
public staticacross 17 test files.
---
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests in the Core Handbook for more details.
Use of AI Tools
This refactoring was identified and verified using Antigravity with Claude 3.7 Sonnet. All unit tests were executed and verified locally with PHPUnit.
This ticket was mentioned in PR #14399 on WordPress/wordpress-develop by @rejaulalomkhan.
4 weeks ago
#41
Description
In PHPUnit 10+, data provider methods must be public and static. In preparation for upgrading the test suite to PHPUnit 10 and beyond, data provider methods in the WordPress Core test suite are being converted to public static.
This PR updates all data provider methods across tests/phpunit/tests/canonical/ to be public static:
- Makes 7 data provider methods
public staticacross 6 test files.
---
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests in the Core Handbook for more details.
Use of AI Tools
This refactoring was identified and verified using Antigravity with Claude 3.7 Sonnet. All unit tests were executed and verified locally with PHPUnit.
This ticket was mentioned in PR #14400 on WordPress/wordpress-develop by @rejaulalomkhan.
4 weeks ago
#42
Description
In PHPUnit 10+, data provider methods must be public and static. In preparation for upgrading the test suite to PHPUnit 10 and beyond, data provider methods in the WordPress Core test suite are being converted to public static.
This PR updates all data provider methods across tests/phpunit/tests/fonts/ to be public static:
- Makes 18 data provider methods
public staticacross 7 test files.
---
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests in the Core Handbook for more details.
Use of AI Tools
This refactoring was identified and verified using Antigravity with Claude 3.7 Sonnet. All unit tests were executed and verified locally with PHPUnit.
@lancewillett commented on PR #14381:
4 weeks ago
#44
PR #14381 landed in https://core.trac.wordpress.org/changeset/64439
@lancewillett commented on PR #14382:
4 weeks ago
#46
PR #14382 landed in https://core.trac.wordpress.org/changeset/64440
@lancewillett commented on PR #14389:
4 weeks ago
#48
PR #14389 landed in https://core.trac.wordpress.org/changeset/64441
@lancewillett commented on PR #14391:
4 weeks ago
#50
PR #14391 landed in https://core.trac.wordpress.org/changeset/64442
@lancewillett commented on PR #14392:
4 weeks ago
#52
PR #14392 landed in https://core.trac.wordpress.org/changeset/64443
@lancewillett commented on PR #14393:
4 weeks ago
#54
PR #14393 landed in https://core.trac.wordpress.org/changeset/64444
@lancewillett commented on PR #14395:
4 weeks ago
#56
PR #14395 landed in https://core.trac.wordpress.org/changeset/64445
@lancewillett commented on PR #14396:
4 weeks ago
#58
PR #14396 landed in https://core.trac.wordpress.org/changeset/64446
@lancewillett commented on PR #14397:
4 weeks ago
#60
PR #14397 landed in https://core.trac.wordpress.org/changeset/64447
@lancewillett commented on PR #14400:
4 weeks ago
#62
PR #14400 landed in https://core.trac.wordpress.org/changeset/64448
@lancewillett commented on PR #14398:
4 weeks ago
#65
PR #14398 landed in https://core.trac.wordpress.org/changeset/64449
@lancewillett commented on PR #14399:
4 weeks ago
#66
PR #14399 landed in https://core.trac.wordpress.org/changeset/64450
This ticket was mentioned in PR #14440 on WordPress/wordpress-develop by @therssoftware.
4 weeks ago
#67
Summary
Declare the data providers in tests/phpunit/tests/ajax/ as public static for compatibility with newer PHPUnit versions. Preserve their datasets and assertions.
Testing Instructions
Run:
vendor/bin/phpunit --group ajax
vendor/bin/phpcs tests/phpunit/tests/ajax/
All tests pass cleanly.
Props @therssoftware.
This ticket was mentioned in PR #14443 on WordPress/wordpress-develop by @therssoftware.
4 weeks ago
#68
Summary
Declare the data providers in tests/phpunit/tests/ajax/ as public static for compatibility with newer PHPUnit versions. Preserve their datasets and assertions.
Testing Instructions
Run:
vendor/bin/phpunit --group ajax
vendor/bin/phpcs tests/phpunit/tests/ajax/
All tests pass cleanly.
Props @therssoftware.
This ticket was mentioned in PR #14460 on WordPress/wordpress-develop by @therssoftware.
4 weeks ago
#69
Summary
Declare the data providers in tests/phpunit/tests/rewrite/ as public static for compatibility with newer PHPUnit versions. Preserve their datasets and assertions.
Testing Instructions
Run:
vendor/bin/phpunit --group rewrite
vendor/bin/phpcs tests/phpunit/tests/rewrite/
All tests pass cleanly.
Props @therssoftware.
This ticket was mentioned in PR #14462 on WordPress/wordpress-develop by @therssoftware.
4 weeks ago
#70
Summary
Declare the data providers in tests/phpunit/tests/media/ as public static for compatibility with newer PHPUnit versions. Preserve their datasets and assertions.
Testing Instructions
Run:
vendor/bin/phpunit --group media
vendor/bin/phpcs tests/phpunit/tests/media/
All tests pass cleanly.
Props @therssoftware.
@lancewillett commented on PR #14443:
4 weeks ago
#71
Optional follow-up: shortcode_provider() reads self::$media_id before wpSetUpBeforeClass() creates the attachment, so the gallery cases currently receive an empty ID. This predates the static conversion and does not block landing. Return a literal placeholder such as [gallery ids="%d"] from the provider, then substitute the fixture ID inside test_parse_shortcode() after setup. Keep the existing expected results.
<sub>AI review · <code>gpt-6</code></sub>
@lancewillett commented on PR #14443:
4 weeks ago
#73
PR #14443 landed in https://core.trac.wordpress.org/changeset/64505
@lancewillett commented on PR #14440:
4 weeks ago
#75
PR #14440 landed in https://core.trac.wordpress.org/changeset/64506
@lancewillett commented on PR #14460:
4 weeks ago
#77
PR #14460 landed in https://core.trac.wordpress.org/changeset/64507
@lancewillett commented on PR #14462:
4 weeks ago
#79
PR #14462 landed in https://core.trac.wordpress.org/changeset/64580
This ticket was mentioned in PR #14670 on WordPress/wordpress-develop by @ravipatel.
4 weeks ago
#81
Makes the 14 data providers in tests/phpunit/tests/secrets/ static. PHPUnit 10 deprecates data providers that are not public and static, and PHPUnit 11 removes support for them.
None of these providers use $this, so only the static keyword is added. Seven files change, with one word per provider.
Testing Instructions
Run each changed file, on single site and multisite:
npm run test:php -- tests/phpunit/tests/secrets/
All tests pass. The skipped tests in wpSecretsConfigKeyProvider.php and wpSecretsKeyManager.php depend on the environment, and are skipped the same way on trunk.
Use of AI Tools
AI assistance: Yes
Tool(s): Claude Code
Used for: Finding the providers, making the change and running the tests. I reviewed the diff.
#82
@
4 weeks ago
PR: https://github.com/WordPress/wordpress-develop/pull/14670
Makes the 14 data providers in tests/phpunit/tests/secrets/ static. None of them use $this, so only the static keyword is added. All seven changed files pass on single site and multisite.
This ticket was mentioned in PR #14763 on WordPress/wordpress-develop by @devmuhib.
3 weeks ago
#83
What
Makes data providers static in tests/phpunit/tests/user/query.php.
Why
Data providers in PHPUnit that do not rely on instance state should be declared static to adhere to modern PHPUnit best practices and improve test execution efficiency.
How
- Updates
data_orderby_should_convert_non_prefixed_keys(),data_returning_field_subset_as_string(),data_returning_field_subset_as_array(), anddata_compat_fields()to be declared aspublic static function.
This ticket was mentioned in PR #14764 on WordPress/wordpress-develop by @devmuhib.
3 weeks ago
#84
What
Makes data providers static in tests/phpunit/tests/block-templates/buildBlockTemplateResultFromFile.php and tests/phpunit/tests/block-templates/getTemplateHierarchy.php.
Why
Data providers in PHPUnit that do not rely on instance state should be declared static to adhere to modern PHPUnit best practices and improve test execution efficiency.
How
- Updates
data_build_template_injects_theme_attribute()inbuildBlockTemplateResultFromFile.phptopublic static function. - Updates
data_get_template_hierarchy()ingetTemplateHierarchy.phptopublic static function.
This ticket was mentioned in PR #14765 on WordPress/wordpress-develop by @devmuhib.
3 weeks ago
#85
What
Makes data providers static in tests/phpunit/tests/block-supports/colors.php and tests/phpunit/tests/block-supports/duotone.php.
Why
Data providers in PHPUnit that do not rely on instance state should be declared static to adhere to modern PHPUnit best practices and improve test execution efficiency.
How
- Updates
data_background_color_has_background_with_a_clip()incolors.phptopublic static function. - Updates
data_render_duotone_support_invalid_attribute()induotone.phptopublic static function.
This ticket was mentioned in PR #14766 on WordPress/wordpress-develop by @devmuhib.
3 weeks ago
#86
What
Makes data providers static in tests/phpunit/tests/basic.php and tests/phpunit/tests/block-template-utils.php.
Why
Data providers in PHPUnit that do not rely on instance state should be declared static to adhere to modern PHPUnit best practices and improve test execution efficiency.
How
- Updates
data_package_lock_json()intests/phpunit/tests/basic.phptopublic static function. - Updates
data_remove_theme_attribute_in_block_template_content()intests/phpunit/tests/block-template-utils.phptopublic static function.
This ticket was mentioned in PR #14771 on WordPress/wordpress-develop by @therssoftware.
3 weeks ago
#87
Description
Makes the 35 PHPUnit data provider methods across 15 files in tests/phpunit/tests/multisite/ public static, as part of the PHPUnit 10+ migration (#62004, #66211).
PHPUnit 10 deprecated non-static data providers and PHPUnit 11 removed support for them. PHPUnit 9 accepts static providers, so this can land ahead of the upgrade.
None of the providers use $this or depend on instance state, so only the method signatures change. Behavior, test datasets, and assertions remain identical.
Files Changed:
tests/phpunit/tests/multisite/bootstrap.php:data_get_network_by_path()data_get_network_by_path_with_zero_path_segments()data_get_site_by_path()data_multisite_bootstrap()
tests/phpunit/tests/multisite/forceSslContent.php:data_force_ssl_content()
tests/phpunit/tests/multisite/getBlogDetails.php:data_get_all()
tests/phpunit/tests/multisite/getSpaceAllowed.php:data_blog_upload_space()
tests/phpunit/tests/multisite/isEmailAddressUnsafe.php:data_unsafe()data_safe()
tests/phpunit/tests/multisite/network.php:data_upload_size_limit_filter_empty_fileupload_maxk()data_wp_is_large_network()data_wp_is_large_network_filtered_by_component()data_wp_is_large_network_filtered_by_network()data_get_instance_treats_a_poisoned_cache_value_as_a_cache_miss()
tests/phpunit/tests/multisite/site.php:data_new_blog_url_schemes()data_get_site_caches()data_wp_insert_site()data_wp_update_site()data_wp_normalize_site_data()data_wp_validate_site_data()data_site_status_hook_triggers()data_wp_initialize_site()data_wpmu_new_blog_action_backward_compatible()
tests/phpunit/tests/multisite/siteDetails.php:data_allowed_options()
tests/phpunit/tests/multisite/updateBlogDetails.php:data_flag_hooks()data_single_directory_path()
tests/phpunit/tests/multisite/upgradeNetwork.php:data_can_compress_scripts_deletion()
tests/phpunit/tests/multisite/wpGetSites.php:data_wp_get_sites()
tests/phpunit/tests/multisite/wpSite.php:data_get_instance_returns_false_for_an_empty_site_id()data_get_instance_treats_a_poisoned_cache_value_as_a_cache_miss()data_get_instance_treats_a_numeric_cache_value_as_a_cached_miss()
tests/phpunit/tests/multisite/wpSiteQuery.php:data_wp_site_query_meta_query()
tests/phpunit/tests/multisite/wpmuValidateBlogSignup.php:data_validate_blogname()data_filter_minimum_site_name_length()
tests/phpunit/tests/multisite/wpmuValidateUserSignup.php:data_user_name()
Testing Instructions
- Run PHPUnit on the multisite test suite:
vendor/bin/phpunit -c tests/phpunit/multisite.xml --test-suffix .php tests/phpunit/tests/multisite/
Expected result:
OK, but incomplete, skipped, or risky tests! Tests: 677, Assertions: 1498, Skipped: 4.(100% pass, matching baseline).
- Run PHPCS to verify coding standards across all files in the directory:
vendor/bin/phpcs tests/phpunit/tests/multisite/
Expected result: 0 errors and 0 warnings.
!== Use of AI Tools ==
AI assistance: Yes
Tool(s): Antigravity
Model(s): Gemini
Used for: Scanning data provider signatures across tests/phpunit/tests/multisite/, updating method declarations to public static, and verifying tests and coding standards. Implementation and test verification were reviewed and executed locally by therssoftware.
This ticket was mentioned in PR #14832 on WordPress/wordpress-develop by @benitoalba.
3 weeks ago
#88
shortcode_provider() runs before wpSetUpBeforeClass(), so the gallery datasets contain [gallery ids=" "] instead of the attachment ID. The allowed gallery case still succeeds, but adding a second attachment shows that its response can include unrelated media.
Return %d placeholders from the provider and fill them in when the test runs, after fixture setup. Add an unrelated attachment and check that the allowed gallery includes the intended caption and excludes the other one. All three datasets keep their existing success and rejection expectations.
This follows the optional follow-up on #14443. The fixture issue predates the conversion to a static provider.
Testing
Tested on PHP 8.3.36 with PHPUnit 9.6.36 and MariaDB:
- With the original ID handling, the strengthened gallery case fails because the response contains the unrelated caption. With the fix, all 3 cases pass with 6 assertions on single site and multisite.
- The full AJAX directory passes in randomized order (seed
66211): 190 tests and 1,113 assertions on single site; 202 tests and 805 assertions on multisite. Each run skips one test. - WordPress coding standards, PHP compatibility, and
git diff --checkpass.
php vendor/bin/phpunit --group ajax --test-suffix .php --order-by=random --random-order-seed=66211 tests/phpunit/tests/ajax/ php vendor/bin/phpunit -c tests/phpunit/multisite.xml --group ajax --test-suffix .php --order-by=random --random-order-seed=66211 tests/phpunit/tests/ajax/ php vendor/bin/phpcs tests/phpunit/tests/ajax/wpAjaxParseMediaShortcode.php php vendor/bin/phpcs --standard=phpcompat.xml.dist tests/phpunit/tests/ajax/wpAjaxParseMediaShortcode.php
Use of AI Tools
AI assistance: Yes. OpenAI Codex researched the follow-up, wrote the change and assertions, ran local validation, and drafted this description.
This ticket was mentioned in PR #14887 on WordPress/wordpress-develop by @benitoalba.
3 weeks ago
#89
Make the 16 data providers in tests/phpunit/tests/filesystem/ public static, as requested in the Trac ticket. PHPUnit 10 deprecates non-static providers, and PHPUnit 11 requires static ones. None of these providers uses $this, so each edit only adds static to a declaration.
Testing
Tested with PHP 8.3.36 and PHPUnit 9.6.38 in a local Linux container with a separate MariaDB test database.
- Ran the full filesystem directory before and after the change on single site and multisite. All four runs report 161 tests and 296 assertions, with no errors or failures.
- The same 20 warnings about the existing
expectError()calls occur before and after the change. - WordPress coding standards pass for all 34 PHP files in the directory, and
git diff --checkpasses.
php vendor/bin/phpunit --no-logging --test-suffix .php tests/phpunit/tests/filesystem php vendor/bin/phpunit --no-logging -c tests/phpunit/multisite.xml --test-suffix .php tests/phpunit/tests/filesystem php vendor/bin/phpcs -s tests/phpunit/tests/filesystem git diff --check
Use of AI Tools
AI assistance: Yes. OpenAI Codex researched the ticket, updated the provider declarations, ran the comparative tests, and drafted this description.
#90
follow-up:
↓ 109
@
3 weeks ago
@lancewillett I reviewed the PRs related to this ticket, and I feel there are too many to go through and review individually.
Instead, could we consolidate the changes into a smaller number of PRs (around 6–8), each covering a logical group of changes needed for this ticket? I noticed that some PRs only change a single file, which creates a lot of overhead in reviewing and committing them individually.
What do you think?
This ticket was mentioned in PR #14622 on WordPress/wordpress-develop by @shailu25.
3 weeks ago
#91
What
Trac ticket: #66211
Updates the data provider method in tests/phpunit/tests/post/wpCountPosts.php to be public static function in alignment with PHPUnit 10+ requirements.
This is a test-only change.
Why
In PHPUnit 10+, calling non-static data providers is deprecated and will become fatal. Data providers that do not rely on instance state should be declared public static.
How
- Updated
data_non_stdclass_values()inTests_Post_wpCountPostsfrompublic functiontopublic static function.
Testing instructions
Run the wp_count_posts test suite:
npm run test:php -- --filter Tests_Post_wpCountPosts
Use of AI Tools
- Cursor
This ticket was mentioned in PR #14806 on WordPress/wordpress-develop by @shailu25.
3 weeks ago
#92
What
Trac ticket: Trac ticket: #66211
Makes the data providers in tests/phpunit/tests/locale.php static.
Why
PHPUnit data providers should be static so they do not depend on test instance state and remain compatible with current PHPUnit usage in Core.
How
- Convert
data_property_initializes_to_array()topublic static - Convert
data_get_word_count_type()topublic static
Test-only; no production code changes.
Testing Instructions
npm run test:php -- --filter Tests_Localenpm run test:php -- --filter Tests_Locale -c tests/phpunit/multisite.xmlnpm run test:php -- --filter Tests_Locale --order-by=randomnpm run test:php -- --group l10n
Use of AI Tools
- Cursor
This ticket was mentioned in PR #14807 on WordPress/wordpress-develop by @shailu25.
3 weeks ago
#93
What
Trac ticket: #66211
Makes the data providers in tests/phpunit/tests/file.php static.
Why
PHPUnit data providers should be static so they do not depend on test instance state and remain compatible with current PHPUnit usage in Core.
How
- Convert
data_wp_tempnam_filenames()topublic static - Convert
data_wp_tempnam_should_limit_filename_length_to_252_characters()topublic static
Test-only; no production code changes.
Testing Instructions
npm run test:php -- --filter Tests_Filenpm run test:php -- --filter Tests_File -c tests/phpunit/multisite.xmlnpm run test:php -- --filter Tests_File --order-by=randomnpm run test:php -- --group file
Use of AI Tools
- Cursor
This ticket was mentioned in PR #14805 on WordPress/wordpress-develop by @shailu25.
3 weeks ago
#94
What
Trac ticket: #66211
Makes the data provider in tests/phpunit/tests/category/walkerCategory.php static.
Why
PHPUnit data providers should be static so they do not depend on test instance state and remain compatible with current PHPUnit usage in Core.
How
- Convert
data_start_el_with_empty_attributes()topublic static
Test-only; no production code changes.
Testing Instructions
npm run test:php -- --filter Tests_Category_Walker_Categorynpm run test:php -- --filter Tests_Category_Walker_Category -c tests/phpunit/multisite.xmlnpm run test:php -- --filter Tests_Category_Walker_Category --order-by=randomnpm run test:php -- --group category
Use of AI Tools
- Cursor
This ticket was mentioned in PR #14804 on WordPress/wordpress-develop by @shailu25.
3 weeks ago
#95
What
Trac ticket: #66211
Makes the data provider in tests/phpunit/tests/dependencies/jquery.php static.
Why
PHPUnit data providers should be static so they do not depend on test instance state and remain compatible with current PHPUnit usage in Core.
How
- Convert
data_jquery_files_exist()topublic static
Test-only; no production code changes.
Testing Instructions
npm run test:php -- --filter Tests_Dependencies_jQuerynpm run test:php -- --filter Tests_Dependencies_jQuery -c tests/phpunit/multisite.xmlnpm run test:php -- --filter Tests_Dependencies_jQuery --order-by=randomnpm run test:php -- --group scripts
Use of AI Tools
- Cursor
This ticket was mentioned in PR #14803 on WordPress/wordpress-develop by @shailu25.
3 weeks ago
#96
What
Trac ticket: #66211
Makes the data provider in tests/phpunit/tests/rewrite.php static.
Why
PHPUnit data providers should be static so they do not depend on test instance state and remain compatible with current PHPUnit usage in Core.
How
- Convert
data_url_to_postid_host_matching()topublic static
Test-only; no production code changes.
Testing Instructions
npm run test:php -- --filter Tests_Rewritenpm run test:php -- --filter Tests_Rewrite -c tests/phpunit/multisite.xmlnpm run test:php -- --filter Tests_Rewrite --order-by=randomnpm run test:php -- --group rewrite
Use of AI Tools
- Cursor
This ticket was mentioned in PR #14801 on WordPress/wordpress-develop by @shailu25.
3 weeks ago
#97
What
Trac ticket: #66211
Makes the data provider in tests/phpunit/tests/comment/getLastCommentModified.php static.
Why
PHPUnit data providers should be static so they do not depend on test instance state and remain compatible with current PHPUnit usage in Core.
How
- Convert
data_internal_comment_types_are_excluded()topublic static
Test-only; no production code changes.
Testing Instructions
npm run test:php -- --filter Tests_Comment_GetLastCommentModifiednpm run test:php -- --filter Tests_Comment_GetLastCommentModified -c tests/phpunit/multisite.xmlnpm run test:php -- --filter Tests_Comment_GetLastCommentModified --order-by=randomnpm run test:php -- --group comment
Use of AI Tools
- Cursor
This ticket was mentioned in PR #14800 on WordPress/wordpress-develop by @shailu25.
3 weeks ago
#98
What
Trac ticket: #66211
Makes the data provider in tests/phpunit/tests/db/realEscape.php static.
Why
PHPUnit data providers should be static so they do not depend on test instance state and remain compatible with current PHPUnit usage in Core.
How
- Convert
data_real_escape_input_type_handling()topublic static
Test-only; no production code changes.
Testing Instructions
npm run test:php -- --filter Tests_DB_RealEscapenpm run test:php -- --filter Tests_DB_RealEscape -c tests/phpunit/multisite.xmlnpm run test:php -- --filter Tests_DB_RealEscape --order-by=randomnpm run test:php -- --group wpdb
Use of AI Tools
- Cursor
This ticket was mentioned in PR #14623 on WordPress/wordpress-develop by @shailu25.
3 weeks ago
#99
What
Trac ticket: #66211
Updates the data provider method in tests/phpunit/tests/post/wpCountAttachments.php to be public static function in alignment with PHPUnit 10+ requirements.
This is a test-only change.
Why
In PHPUnit 10+, calling non-static data providers is deprecated and will become fatal. Data providers that do not rely on instance state should be declared public static.
How
- Updated
data_non_stdclass_values()inTests_Post_wpCountAttachmentsfrompublic functiontopublic static function.
Testing instructions
Run the wp_count_attachments test suite:
npm run test:php -- --filter Tests_Post_wpCountAttachments
Use of AI Tools
- Cursor
This ticket was mentioned in PR #14624 on WordPress/wordpress-develop by @shailu25.
3 weeks ago
#100
What
Trac ticket: #66211
Updates the data provider method in tests/phpunit/tests/post/truncatePostSlug.php to be public static function in alignment with PHPUnit 10+ requirements.
This is a test-only change.
Why
In PHPUnit 10+, calling non-static data providers is deprecated and will become fatal. Data providers that do not rely on instance state should be declared public static.
How
- Updated
data_truncate_post_slug_should_truncate()inTests_Post_TruncatePostSlugfrompublic functiontopublic static function.
Testing instructions
Run the truncate_post_slug test suite:
npm run test:php -- --filter Tests_Post_TruncatePostSlug
Use of AI Tools
- Cursor
This ticket was mentioned in PR #14788 on WordPress/wordpress-develop by @shailu25.
3 weeks ago
#101
What
Trac ticket: #66211
Makes the data provider in tests/phpunit/tests/taxonomy.php static.
Why
PHPUnit data providers should be static so they do not depend on test instance state and remain compatible with current PHPUnit usage in Core.
How
- Convert
data_taxonomy_exists_should_return_false_with_non_string_taxonomy()topublic static
Test-only; no production code changes.
Testing Instructions
npm run test:php -- --filter Tests_Taxonomynpm run test:php -- --filter Tests_Taxonomy -c tests/phpunit/multisite.xmlnpm run test:php -- --filter Tests_Taxonomy --order-by=randomnpm run test:php -- --group taxonomy
Use of AI Tools
- Cursor
This ticket was mentioned in PR #14790 on WordPress/wordpress-develop by @shailu25.
3 weeks ago
#102
What
Trac ticket: #66211
Makes the data providers in tests/phpunit/tests/filters.php static.
Why
PHPUnit data providers should be static so they do not depend on test instance state and remain compatible with current PHPUnit usage in Core.
How
- Convert
data_priority_callback_order_with_integers()topublic static - Convert
data_priority_callback_order_with_unhappy_path_nonintegers()topublic static
Test-only; no production code changes.
Testing Instructions
npm run test:php -- --filter Tests_Filtersnpm run test:php -- --filter Tests_Filters -c tests/phpunit/multisite.xmlnpm run test:php -- --filter Tests_Filters --order-by=random
Use of AI Tools
- Cursor
This ticket was mentioned in PR #14791 on WordPress/wordpress-develop by @shailu25.
3 weeks ago
#103
What
Trac ticket: #66211
Makes the data providers in tests/phpunit/tests/term.php static.
Why
PHPUnit data providers should be static so they do not depend on test instance state and remain compatible with current PHPUnit usage in Core.
How
- Convert
data_wp_set_term_objects_finds_term_name_with_special_characters()topublic static - Convert
data_get_term_filter()topublic static
Test-only; no production code changes.
Testing Instructions
npm run test:php -- --filter Tests_Termnpm run test:php -- --filter Tests_Term -c tests/phpunit/multisite.xmlnpm run test:php -- --filter Tests_Term --order-by=randomnpm run test:php -- --group taxonomy
Use of AI Tools
- Cursor
This ticket was mentioned in PR #14792 on WordPress/wordpress-develop by @shailu25.
3 weeks ago
#104
What
Trac ticket: #66211
Makes the data providers in tests/phpunit/tests/canonical.php static.
Why
PHPUnit data providers should be static so they do not depend on test instance state and remain compatible with current PHPUnit usage in Core.
How
- Convert
data_canonical()topublic static - Convert
data_redirect_guess_404_permalink_with_custom_statuses()topublic static - Convert
data_redirect_guess_404_permalink_post_types()topublic static - Convert
data_canonical_attachment_page_redirect_with_option_disabled()topublic static
Test-only; no production code changes.
Testing Instructions
npm run test:php -- --filter Tests_Canonicalnpm run test:php -- --filter Tests_Canonical -c tests/phpunit/multisite.xmlnpm run test:php -- --filter Tests_Canonical --order-by=randomnpm run test:php -- --group canonical
Use of AI Tools
- Cursor
This ticket was mentioned in PR #14793 on WordPress/wordpress-develop by @shailu25.
3 weeks ago
#105
What
Trac ticket: #66211
Makes the data providers in tests/phpunit/tests/shortcode.php static.
Why
PHPUnit data providers should be static so they do not depend on test instance state and remain compatible with current PHPUnit usage in Core.
How
- Convert
data_strip_shortcodes()topublic static - Convert
data_escaping()topublic static - Convert
data_escaping2()topublic static - Convert
data_registration_bad()topublic static - Convert
data_registration_good()topublic static - Convert
data_whole_posts()topublic static
Test-only; no production code changes.
Testing Instructions
npm run test:php -- --filter Tests_Shortcodenpm run test:php -- --filter Tests_Shortcode -c tests/phpunit/multisite.xmlnpm run test:php -- --filter Tests_Shortcode --order-by=randomnpm run test:php -- --group shortcode
Use of AI Tools
- Cursor
This ticket was mentioned in PR #14799 on WordPress/wordpress-develop by @shailu25.
3 weeks ago
#106
What
Trac ticket: #66211
Makes the data provider in tests/phpunit/tests/cache.php static.
Why
PHPUnit data providers should be static so they do not depend on test instance state and remain compatible with current PHPUnit usage in Core.
How
- Convert
data_is_valid_key()topublic static
Test-only; no production code changes.
Testing Instructions
npm run test:php -- --filter Tests_Cachenpm run test:php -- --filter Tests_Cache -c tests/phpunit/multisite.xmlnpm run test:php -- --filter Tests_Cache --order-by=randomnpm run test:php -- --group cache
Use of AI Tools
- Cursor
This ticket was mentioned in PR #14802 on WordPress/wordpress-develop by @shailu25.
3 weeks ago
#107
What
Trac ticket: #66211
Makes the data provider in tests/phpunit/tests/dependencies.php static.
Why
PHPUnit data providers should be static so they do not depend on test instance state and remain compatible with current PHPUnit usage in Core.
How
- Convert
data_provider_get_etag()topublic static
Test-only; no production code changes.
Testing Instructions
npm run test:php -- --filter Tests_Dependenciesnpm run test:php -- --filter Tests_Dependencies -c tests/phpunit/multisite.xmlnpm run test:php -- --filter Tests_Dependencies --order-by=randomnpm run test:php -- --group dependencies
Use of AI Tools
- Cursor
@shailu25 commented on PR #14802:
3 weeks ago
#108
Thanks for the review. I have updated the ticket number in all the mentioned PRs.
#109
in reply to: ↑ 90
@
3 weeks ago
Replying to mukesh27:
@lancewillett I reviewed the PRs related to this ticket, and I feel there are too many to go through and review individually.
Instead, could we consolidate the changes into a smaller number of PRs (around 6–8), each covering a logical group of changes needed for this ticket? I noticed that some PRs only change a single file, which creates a lot of overhead in reviewing and committing them individually.
What do you think?
@mukesh27 Agreed, and thanks for reviewing so many of these.
I'll land them in groups by test area, one commit per group, so no one needs to open new PRs. Each commit will link every PR it includes and give props to its authors. The ones you've already approved go first.
If you're picking up a new directory, please send one PR per directory, as the description asks, rather than one per file. That keeps review and commits manageable.
@lancewillett commented on PR #14887:
3 weeks ago
#110
Optional follow-up in a separate PR: test_should_delete_a_file() appends the fixture key to the resolved path, so it currently checks deletion of a nonexistent file. Use self::$file_structure[ $file ]['path'] without the trailing . $file, and assert that the file exists before deleting it. That would ensure both datasets exercise deletion of a real file. This predates the static-provider change and does not block landing.
<sub>AI review · <code>gpt-6</code></sub>
@lancewillett commented on PR #14764:
3 weeks ago
#112
PR #14764 landed in https://core.trac.wordpress.org/changeset/64741
@lancewillett commented on PR #14765:
3 weeks ago
#113
PR #14765 landed in https://core.trac.wordpress.org/changeset/64741
@lancewillett commented on PR #14766:
3 weeks ago
#114
PR #14766 landed in https://core.trac.wordpress.org/changeset/64741
@lancewillett commented on PR #14763:
3 weeks ago
#116
PR #14763 landed in https://core.trac.wordpress.org/changeset/64742
@lancewillett commented on PR #14771:
3 weeks ago
#117
PR #14771 landed in https://core.trac.wordpress.org/changeset/64742
@lancewillett commented on PR #14622:
3 weeks ago
#119
PR #14622 landed in https://core.trac.wordpress.org/changeset/64743
@lancewillett commented on PR #14623:
3 weeks ago
#120
PR #14623 landed in https://core.trac.wordpress.org/changeset/64743
@lancewillett commented on PR #14624:
3 weeks ago
#121
PR #14624 landed in https://core.trac.wordpress.org/changeset/64743
@lancewillett commented on PR #14788:
3 weeks ago
#122
PR #14788 landed in https://core.trac.wordpress.org/changeset/64743
@lancewillett commented on PR #14791:
3 weeks ago
#123
PR #14791 landed in https://core.trac.wordpress.org/changeset/64743
@lancewillett commented on PR #14801:
3 weeks ago
#124
PR #14801 landed in https://core.trac.wordpress.org/changeset/64743
@lancewillett commented on PR #14805:
3 weeks ago
#125
PR #14805 landed in https://core.trac.wordpress.org/changeset/64743
@lancewillett commented on PR #14790:
3 weeks ago
#127
PR #14790 landed in https://core.trac.wordpress.org/changeset/64744
@lancewillett commented on PR #14792:
3 weeks ago
#128
PR #14792 landed in https://core.trac.wordpress.org/changeset/64744
@lancewillett commented on PR #14793:
3 weeks ago
#129
PR #14793 landed in https://core.trac.wordpress.org/changeset/64744
@lancewillett commented on PR #14803:
3 weeks ago
#130
PR #14803 landed in https://core.trac.wordpress.org/changeset/64744
@lancewillett commented on PR #14807:
3 weeks ago
#132
PR #14807 landed in https://core.trac.wordpress.org/changeset/64745
@lancewillett commented on PR #14887:
3 weeks ago
#133
PR #14887 landed in https://core.trac.wordpress.org/changeset/64745
@lancewillett commented on PR #14670:
3 weeks ago
#135
PR #14670 landed in https://core.trac.wordpress.org/changeset/64745
@lancewillett commented on PR #14799:
3 weeks ago
#136
PR #14799 landed in https://core.trac.wordpress.org/changeset/64745
@lancewillett commented on PR #14800:
3 weeks ago
#137
PR #14800 landed in https://core.trac.wordpress.org/changeset/64745
@lancewillett commented on PR #14802:
3 weeks ago
#138
PR #14802 landed in https://core.trac.wordpress.org/changeset/64745
@lancewillett commented on PR #14804:
3 weeks ago
#139
PR #14804 landed in https://core.trac.wordpress.org/changeset/64745
@lancewillett commented on PR #14806:
3 weeks ago
#140
PR #14806 landed in https://core.trac.wordpress.org/changeset/64745
@lancewillett commented on PR #14832:
3 weeks ago
#142
PR #14832 landed in https://core.trac.wordpress.org/changeset/64747
This ticket was mentioned in PR #14904 on WordPress/wordpress-develop by @huzaifaalmesbah.
3 weeks ago
#143
Description
Declares all 33 data providers across the 19 files in tests/phpunit/tests/post/ as public static for compatibility with newer PHPUnit versions (PHPUnit 10 deprecated non-public/non-static data providers, and PHPUnit 11 removed support for them).
In getPost.php, the test post instance helper was declared private static to allow safe execution inside data provider closures without relying on instance state. In wpInsertPost.php, calls were updated to self::text_array_to_dataprovider().
Testing Instructions
Run PHPUnit test suite for the post tests:
# Single site npm run test:php -- --test-suffix .php tests/phpunit/tests/post/ # Multisite npm run test:php -- -c tests/phpunit/multisite.xml --test-suffix .php tests/phpunit/tests/post/
Verify that PHPCS passes:
vendor/bin/phpcs tests/phpunit/tests/post/
Use of AI Tools
AI assistance: Yes
Tool(s): Google Antigravity
Model(s): Gemini 3.8 Flash
Used for: Brainstorming edge-case scenarios and drafting test boilerplate; test architecture, assertions, and local PHPUnit verification were written and validated by me.
This ticket was mentioned in PR #14905 on WordPress/wordpress-develop by @huzaifaalmesbah.
3 weeks ago
#144
Description
Declares all 24 data providers across the 6 files in tests/phpunit/tests/query/ as public static for compatibility with newer PHPUnit versions (PHPUnit 10 deprecated non-public/non-static data providers, and PHPUnit 11 removed support for them).
None of these data providers rely on instance state ($this), preserving existing datasets and assertions untouched.
Testing Instructions
Run PHPUnit test suite for the query tests:
# Single site npm run test:php -- --test-suffix .php tests/phpunit/tests/query/ # Multisite npm run test:php -- -c tests/phpunit/multisite.xml --test-suffix .php tests/phpunit/tests/query/
Verify that PHPCS passes:
vendor/bin/phpcs tests/phpunit/tests/query/
Use of AI Tools
AI assistance: Yes
Tool(s): Google Antigravity
Model(s): Gemini 3.8 Flash
Used for: Brainstorming edge-case scenarios and drafting test boilerplate; test architecture, assertions, and local PHPUnit verification were written and validated by me.
This ticket was mentioned in PR #14906 on WordPress/wordpress-develop by @huzaifaalmesbah.
3 weeks ago
#145
Description
Declares all 14 data providers across the 7 files in tests/phpunit/tests/general/ as public static for compatibility with newer PHPUnit versions (PHPUnit 10 deprecated non-public/non-static data providers, and PHPUnit 11 removed support for them).
In feedLinksExtra.php, callback helper methods (cb_return_zero_float and cb_return_zero_string) were made static so they can be referenced cleanly as [__CLASS__, ...] callables inside the data provider without depending on $this.
Testing Instructions
Run PHPUnit test suite for the general tests:
# Single site npm run test:php -- --test-suffix .php tests/phpunit/tests/general/ # Multisite npm run test:php -- -c tests/phpunit/multisite.xml --test-suffix .php tests/phpunit/tests/general/
Verify that PHPCS passes:
vendor/bin/phpcs tests/phpunit/tests/general/
Use of AI Tools
AI assistance: Yes
Tool(s): Google Antigravity
Model(s): Gemini 3.8 Flash
Used for: Brainstorming edge-case scenarios and drafting test boilerplate; test architecture, assertions, and local PHPUnit verification were written and validated by me.
This ticket was mentioned in PR #14907 on WordPress/wordpress-develop by @huzaifaalmesbah.
3 weeks ago
#146
Description
Declares all 115 data providers across the 28 files in tests/phpunit/tests/rest-api/ as public static for compatibility with newer PHPUnit versions (PHPUnit 10 deprecated non-public/non-static data providers, and PHPUnit 11 removed support for them).
In rest-post-meta-fields.php and rest-term-meta-fields.php, internal data provider chaining calls ($this->data_get_subtype_meta_value()) were updated to self::data_get_subtype_meta_value().
Testing Instructions
Run PHPUnit test suite for the REST API tests:
# Single site npm run test:php -- --test-suffix .php tests/phpunit/tests/rest-api/ # Multisite npm run test:php -- -c tests/phpunit/multisite.xml --test-suffix .php tests/phpunit/tests/rest-api/
Verify that PHPCS passes:
vendor/bin/phpcs tests/phpunit/tests/rest-api/
Use of AI Tools
AI assistance: Yes
Tool(s): Google Antigravity
Model(s): Gemini 3.8 Flash
Used for: Brainstorming edge-case scenarios and drafting test boilerplate; test architecture, assertions, and local PHPUnit verification were written and validated by me.
This ticket was mentioned in PR #14908 on WordPress/wordpress-develop by @huzaifaalmesbah.
3 weeks ago
#147
Description
Declares all 40 data providers across the 8 files in tests/phpunit/tests/dependencies/ as public static for compatibility with newer PHPUnit versions (PHPUnit 10 deprecated non-public/non-static data providers, and PHPUnit 11 removed support for them).
In scripts.php, test script registration and inline script helpers (register_test_script, enqueue_test_script, and add_test_inline_script) were made protected static and called via self:: within closures in data_provider_to_test_various_strategy_dependency_chains(), eliminating reliance on instance state.
Testing Instructions
Run PHPUnit test suite for the dependencies tests:
# Single site npm run test:php -- --test-suffix .php tests/phpunit/tests/dependencies/scripts.php tests/phpunit/tests/dependencies/styles.php tests/phpunit/tests/dependencies/wpPrefetchAdminAssets.php tests/phpunit/tests/dependencies/wpRemoveSurroundingEmptyScriptTags.php tests/phpunit/tests/dependencies/wpScriptIs.php tests/phpunit/tests/dependencies/wpScripts/getSrc.php tests/phpunit/tests/dependencies/wpStyles/getRtlSrc.php tests/phpunit/tests/dependencies/wpStyles/getSrc.php # Multisite npm run test:php -- -c tests/phpunit/multisite.xml tests/phpunit/tests/dependencies/scripts.php tests/phpunit/tests/dependencies/styles.php tests/phpunit/tests/dependencies/wpPrefetchAdminAssets.php tests/phpunit/tests/dependencies/wpRemoveSurroundingEmptyScriptTags.php tests/phpunit/tests/dependencies/wpScriptIs.php tests/phpunit/tests/dependencies/wpScripts/getSrc.php tests/phpunit/tests/dependencies/wpStyles/getRtlSrc.php tests/phpunit/tests/dependencies/wpStyles/getSrc.php
Verify that PHPCS passes:
vendor/bin/phpcs tests/phpunit/tests/dependencies/
Use of AI Tools
AI assistance: Yes
Tool(s): Google Antigravity
Model(s): Gemini 3.8 Flash
Used for: Brainstorming edge-case scenarios and drafting test boilerplate; test architecture, assertions, and local PHPUnit verification were written and validated by me.
This ticket was mentioned in PR #14954 on WordPress/wordpress-develop by @rejaulalomkhan.
3 weeks ago
#148
Description
In tests/phpunit/tests/blocks/register.php, several data provider methods were declared as non-static.
Declaring data providers as public static aligns with modern PHPUnit best practices and requirements for PHPUnit 10+.
This PR updates the following data provider methods to public static:
data_register_block_style_handle_uses_correct_core_stylesheetdata_register_block_registers_with_args_override_returns_false_when_name_is_missingdata_register_block_type_accepts_editor_script_arraydata_register_block_type_throws_doing_it_wrongdata_register_block_style_name_contains_spaces
Testing Instructions
Run the block registration unit tests:
vendor/bin/phpunit tests/phpunit/tests/blocks/register.php
Run PHPCS verification:
vendor/bin/phpcs tests/phpunit/tests/blocks/register.php
Use of AI Tools
AI assistance: Yes
Tool(s): Google Antigravity
Model(s): Gemini 3.8 Flash
Used for: Scanning data provider signatures and verifying absence of $this state; static method conversion and local PHPCS/PHPUnit verification were reviewed and validated by me.
This ticket was mentioned in PR #14956 on WordPress/wordpress-develop by @rejaulalomkhan.
3 weeks ago
#149
Description
In Tests_Image_Meta, the data provider data_stream() is declared as a non-static method (public function).
This PR updates data_stream() to be public static function for compatibility with newer PHPUnit versions (PHPUnit 10/11) and best practices, preserving all existing datasets and assertions.
---
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.
Use of AI Tools
- Model: claude-3-7-sonnet / gemini-2.5-pro via Antigravity
- Scope: Identifying non-static data provider
data_stream()inTests_Image_Meta, updating declaration topublic static, and verifying test suite execution with PHPUnit and PHPCS.
This ticket was mentioned in PR #14959 on WordPress/wordpress-develop by @rejaulalomkhan.
3 weeks ago
#150
Description
In Tests_Privacy_wpPrivacyGeneratePersonalDataExportFile, the data providers data_export_data_grouped_invalid_type() and data_contents() are declared as non-static methods (public function).
This PR updates both data providers to be public static function for compatibility with newer PHPUnit versions (PHPUnit 10/11) and best practices, preserving all datasets and assertions.
---
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.
Use of AI Tools
- Model: claude-3-7-sonnet / gemini-2.5-pro via Antigravity
- Scope: Identifying non-static data providers
data_export_data_grouped_invalid_type()anddata_contents()inTests_Privacy_wpPrivacyGeneratePersonalDataExportFile, updating declarations topublic static, and verifying test suite execution with PHPUnit and PHPCS.
This ticket was mentioned in PR #14963 on WordPress/wordpress-develop by @rejaulalomkhan.
3 weeks ago
#151
Description
In PHPUnit 10+, data providers must be declared public static. Declaring them static also avoids instantiating test class fixtures unnecessarily before running data providers.
This PR updates 22 data providers in tests/phpunit/tests/kses.php to public static function, and updates the internal call $this->text_array_to_dataprovider() to self::text_array_to_dataprovider().
---
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.
Use of AI Tools
- Tool: Antigravity
- Model: Gemini 2.5 Pro
- Scope: Identifying non-static data providers in
tests/phpunit/tests/kses.php, refactoring their signatures topublic static, updating$this->text_array_to_dataprovidercall to staticself::, and verifying with PHPUnit and PHPCS.
This ticket was mentioned in PR #14966 on WordPress/wordpress-develop by @rejaulalomkhan.
3 weeks ago
#152
Description
In PHPUnit 10+, data providers must be declared public static. Declaring them static also avoids instantiating test class fixtures unnecessarily before running data providers.
This PR updates 6 data providers in tests/phpunit/tests/auth.php to public static function.
---
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.
Use of AI Tools
- Tool: Antigravity
- Model: Gemini 2.5 Pro
- Scope: Identifying non-static data providers in
tests/phpunit/tests/auth.php, converting them topublic static, and verifying test suite execution via PHPUnit and PHPCS.
This ticket was mentioned in PR #14968 on WordPress/wordpress-develop by @rejaulalomkhan.
3 weeks ago
#153
Description
In Tests_User, data providers are declared as non-static methods (public function).
This PR updates the data providers in Tests_User to be public static function for compatibility with newer PHPUnit versions (PHPUnit 10/11) and modern testing best practices:
data_count_many_users_posts_cached_for_equivalent_arguments()data_illegal_user_logins()data_remember_user()data_wp_new_user_notifications()data_wp_send_new_user_notification_filters()(along with its static return callbacks)data_user_admin_email_confirmation_emails()data_user_change_email_confirmation_emails()
All existing datasets, logic, and assertions are strictly preserved.
---
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.
Use of AI Tools
- Model: claude-3-7-sonnet / gemini-2.5-pro via Antigravity
- Scope: Converting non-static data providers and their helper callbacks in
Tests_Usertopublic static, and verifying test suite execution with PHPUnit and PHPCS.
This ticket was mentioned in PR #14969 on WordPress/wordpress-develop by @rejaulalomkhan.
3 weeks ago
#154
Description
In PHPUnit 10+, data providers must be declared public static. Declaring them static also avoids instantiating test class fixtures unnecessarily before running data providers.
This PR updates 7 data providers in tests/phpunit/tests/comment.php to public static function.
---
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.
Use of AI Tools
- Tool: Antigravity
- Model: Gemini 2.5 Pro
- Scope: Identifying non-static data providers in
tests/phpunit/tests/comment.php, converting their method signatures topublic static, and verifying test suite execution via PHPUnit and PHPCS.
This ticket was mentioned in PR #14970 on WordPress/wordpress-develop by @rejaulalomkhan.
3 weeks ago
#155
Description
In PHPUnit 10+, data providers must be declared public static. Declaring them static also avoids instantiating test class fixtures unnecessarily before running data providers.
This PR updates 3 data providers in tests/phpunit/tests/block-bindings/patternOverridesSource.php to public static function.
---
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.
Use of AI Tools
- Tool: Antigravity
- Model: Gemini 2.5 Pro
- Scope: Identifying non-static data providers in
tests/phpunit/tests/block-bindings/patternOverridesSource.php, converting them topublic static, and verifying test suite execution via PHPUnit and PHPCS.
@huzaifaalmesbah commented on PR #14954:
3 weeks ago
#156
Hi @rejaulalomkhan! Thanks for working on this.
Per Lance's feedback on Trac #66211, committers requested sending one PR per directory rather than individual single-file PRs to keep review and SVN commits manageable.
In tests/phpunit/tests/blocks/, there are a few other files with data providers that could be included in this PR so the entire directory is covered at once:
tests/phpunit/tests/blocks/editor.phptests/phpunit/tests/blocks/render.phptests/phpunit/tests/blocks/supportedStyles.phptests/phpunit/tests/blocks/wpBlock.phptests/phpunit/tests/blocks/wpBlockParser.phptests/phpunit/tests/blocks/wpBlockType.php
Would you like to add these files to this PR to complete the blocks directory?
@huzaifaalmesbah commented on PR #14956:
3 weeks ago
#157
Hi @rejaulalomkhan! Thanks for the PR.
As noted by committers on Trac #66211 (comment:109), it’s preferred to submit one PR per directory instead of single files.
The other files in tests/phpunit/tests/image/ needing static data providers are:
tests/phpunit/tests/image/editor.phptests/phpunit/tests/image/editorGd.phptests/phpunit/tests/image/functions.php
Consolidating these into this PR would allow committers to review and land the entire image directory together.
@huzaifaalmesbah commented on PR #14959:
3 weeks ago
#158
Hi @rejaulalomkhan! Thanks for this PR.
Per Trac #66211 (comment:109), committers asked for one PR per directory. In tests/phpunit/tests/privacy/, there is only one other file with data providers:
tests/phpunit/tests/privacy/wpPrivacyProcessPersonalDataExportPage.php
If you add that file here, the entire privacy directory will be completed in this single PR!
This ticket was mentioned in PR #14971 on WordPress/wordpress-develop by @rejaulalomkhan.
3 weeks ago
#159
Description
In PHPUnit 10+, data providers must be declared public static. Declaring them static also avoids instantiating test class fixtures unnecessarily before running data providers.
This PR updates 3 data providers in tests/phpunit/tests/block-bindings/termDataSource.php to public static function.
---
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.
Use of AI Tools
- Tool: Antigravity
- Model: Gemini 2.5 Pro
- Scope: Identifying non-static data providers in
tests/phpunit/tests/block-bindings/termDataSource.php, converting them topublic static, and verifying test suite execution via PHPUnit and PHPCS.
This ticket was mentioned in PR #14972 on WordPress/wordpress-develop by @therssoftware.
3 weeks ago
#160
Description
Trac ticket: #66211
Declares 9 data providers across tests/phpunit/tests/xmlrpc/ as public static for compatibility with newer PHPUnit versions (PHPUnit 10 deprecated non-public/non-static data providers, and PHPUnit 11 removed support for them).
All datasets and assertions are preserved untouched.
Testing Instructions
Run PHPUnit test suite:
npm run test:php -- tests/phpunit/tests/xmlrpc/demo/addTwoNumbers.php tests/phpunit/tests/xmlrpc/wp/newComment.php tests/phpunit/tests/xmlrpc/wp/uploadFile.phpnpm run test:php -- -c tests/phpunit/multisite.xml tests/phpunit/tests/xmlrpc/demo/addTwoNumbers.php tests/phpunit/tests/xmlrpc/wp/newComment.php tests/phpunit/tests/xmlrpc/wp/uploadFile.phpnpm run test:php -- --group xmlrpc
This ticket was mentioned in PR #15098 on WordPress/wordpress-develop by @rejaulalomkhan.
3 weeks ago
#161
Description
Per Trac #66211 and committer feedback (Comment 109), this PR updates data providers in the entire tests/phpunit/tests/style-engine/ directory to be public static.
PHPUnit data providers that do not rely on test state or $this should be declared as public static to optimize test execution performance and comply with modern PHPUnit standards.
Files updated:
tests/phpunit/tests/style-engine/styleEngine.php:data_wp_style_engine_get_styles()->public static function
tests/phpunit/tests/style-engine/wpStyleEngineCssDeclarations.php:data_should_compile_css_declarations_to_css_declarations_string()->public static function
Testing Instructions
- Run
vendor/bin/phpunit --filter Tests_wpStyleEngine-> PASS (42 tests, 42 assertions). - Run
vendor/bin/phpunit tests/phpunit/tests/style-engine/wpStyleEngineCssDeclarations.php-> PASS (16 tests, 22 assertions). - Run
vendor/bin/phpcs tests/phpunit/tests/style-engine/-> PASS (0 errors, 0 warnings across all 5 files).
---
Use of AI Tools
- Tool: Google Antigravity / Gemini 2.5 Pro
- Purpose: Audited
tests/phpunit/tests/style-engine/directory, converted data providers topublic static, and verified via PHPUnit/PHPCS. All changes inspected and verified locally before submission.
This ticket was mentioned in PR #15102 on WordPress/wordpress-develop by @rejaulalomkhan.
3 weeks ago
#162
Description
Per Trac #66211 and committer feedback (Comment 109), this PR updates the data providers in the entire tests/phpunit/tests/script-modules/ directory to be public static.
PHPUnit data providers that do not rely on test state or $this should be declared as public static to optimize test execution performance and comply with modern PHPUnit standards.
Data providers updated in tests/phpunit/tests/script-modules/wpScriptModules.php:
data_test_register_and_enqueue_script_module()->public static functiondata_provider_fetchpriority_values()->public static functiondata_provider_to_test_fetchpriority_bumping()->public static function
Testing Instructions
- Run
vendor/bin/phpunit --filter test_comprehensive_methods tests/phpunit/tests/script-modules/wpScriptModules.php-> PASS (4 tests, 300 assertions). - Run
vendor/bin/phpunit --filter fetchpriority tests/phpunit/tests/script-modules/wpScriptModules.php-> PASS (12 tests, 79 assertions). - Run
vendor/bin/phpcs tests/phpunit/tests/script-modules/-> PASS (0 errors, 0 warnings).
---
Use of AI Tools
- Tool: Google Antigravity / Gemini 2.5 Pro
- Purpose: Audited
tests/phpunit/tests/script-modules/directory, converted data providers topublic static, and verified via PHPUnit/PHPCS. All changes inspected and verified locally before submission.
This ticket was mentioned in PR #15103 on WordPress/wordpress-develop by @rejaulalomkhan.
3 weeks ago
#163
Description
Per Trac #66211 and committer feedback (Comment 109), this PR updates data providers in the entire tests/phpunit/tests/ai-client/ directory to be public static.
PHPUnit data providers that do not rely on test state or $this should be declared as public static to optimize test execution performance and comply with modern PHPUnit standards.
Data providers updated in tests/phpunit/tests/ai-client/wpAiClientPromptBuilder.php:
data_valid_request_timeout_overrides()->public static functiondata_invalid_request_timeouts()->public static function
Testing Instructions
- Run
vendor/bin/phpunit --filter Tests_AI_Client_PromptBuilder-> PASS (194 tests, 499 assertions). - Run
vendor/bin/phpcs tests/phpunit/tests/ai-client/-> PASS (0 errors, 0 warnings across all 10 files).
---
Use of AI Tools
- Tool: Google Antigravity / Gemini 2.5 Pro
- Purpose: Audited
tests/phpunit/tests/ai-client/directory, converted data providers topublic static, and verified via PHPUnit/PHPCS. All changes inspected and verified locally before submission.
This ticket was mentioned in PR #15104 on WordPress/wordpress-develop by @rejaulalomkhan.
3 weeks ago
#164
Description
Per Trac #66211 and committer feedback (Comment 109), this PR updates data providers in the entire tests/phpunit/tests/rest-api/wpRestUrlDetailsController/ directory to be public static.
PHPUnit data providers that do not rely on test state or $this should be declared as public static to optimize test execution performance and comply with modern PHPUnit standards.
Data providers updated in tests/phpunit/tests/rest-api/wpRestUrlDetailsController/parsing.php:
data_get_title()->public static functiondata_get_icon()->public static functiondata_get_description()->public static functiondata_get_image()->public static function
Testing Instructions
- Run
vendor/bin/phpunit tests/phpunit/tests/rest-api/wpRestUrlDetailsController/parsing.php-> PASS (80 tests, 80 assertions). - Run
vendor/bin/phpcs tests/phpunit/tests/rest-api/wpRestUrlDetailsController/-> PASS (0 errors, 0 warnings).
---
Use of AI Tools
- Tool: Google Antigravity / Gemini 2.5 Pro
- Purpose: Audited
tests/phpunit/tests/rest-api/wpRestUrlDetailsController/directory, converted data providers topublic static, and verified via PHPUnit/PHPCS. All changes inspected and verified locally before submission.
@shailu25 commented on PR #14968:
3 weeks ago
#165
@rejaulalomkhan For follow-up work, please group by directory or in batches of ~6–8 files, as Lance noted on #66211, rather than one PR per file.
@shailu25 commented on PR #14971:
3 weeks ago
#166
LGTM👍
Providers don’t use instance state, so making them static looks correct.
@rejaulalomkhan These two files are both under block-bindings/. Per Lance’s note on #66211, Please group by directory (or ~6–8 files) for follow-ups instead of one PR per file.
@mukesh27 commented on PR #15104:
3 weeks ago
#167
This change to tests/phpunit/tests/rest-api/wpRestUrlDetailsController/parsing.php is identical to the one in #14907, which converts all of rest-api/. Could one of the two be closed so they don't conflict when the other lands?
This ticket was mentioned in PR #15117 on WordPress/wordpress-develop by @rejaulalomkhan.
3 weeks ago
#168
Description
Under Trac ticket #66211 and following committer guidance (Trac #66211 comment 109) to consolidate changes per directory rather than per file, this PR updates all data provider methods across the entire tests/phpunit/tests/editor/ test directory to be public static.
In PHPUnit 10+, data provider methods are required to be declared as static. Converting them to public static ensures forward compatibility while preserving existing test semantics and data sets.
Changes Included
The following 3 test files in tests/phpunit/tests/editor/ have been updated:
tests/phpunit/tests/editor/disableBlockEditorForNavigationPostType.php:data_should_return_false_when_wp_navigation()data_should_return_given_value_for_non_wp_navigation_post_types()
tests/phpunit/tests/editor/disableContentEditorForNavigationPostType.php:data_should_not_disable()data_should_not_change_post_type_support()
tests/phpunit/tests/editor/enableContentEditorForNavigationPostType.php:data_should_not_enable()data_should_not_change_post_type_support()
All remaining files in tests/phpunit/tests/editor/ contain no non-static data providers, making the entire editor/ directory 100% compliant with static data provider requirements.
Testing Instructions
Run the editor test suite locally:
php vendor/phpunit/phpunit/phpunit --filter Tests_Editor vendor/bin/phpcs tests/phpunit/tests/editor/
Verification
- PHPUnit: OK (64 tests, 72 assertions)
- PHPCS: OK (7 files checked, 0 errors, 0 warnings)
---
Use of AI Tools
- Tool: Google Antigravity
- Model: Gemini 2.5 Pro
- Assistance: Code search, batch directory analysis, automated regex replacement for static keyword declarations, and test verification execution.
This ticket was mentioned in PR #15118 on WordPress/wordpress-develop by @rejaulalomkhan.
3 weeks ago
#169
Description
Under Trac ticket #66211 and following committer guidance (Trac #66211 comment 109) to consolidate changes per directory rather than per file, this PR updates all data provider methods across the entire tests/phpunit/tests/icons/ test directory to be public static.
In PHPUnit 10+, data provider methods are required to be declared as static. Converting them to public static ensures forward compatibility while preserving existing test semantics and fixtures.
Changes Included
The following 4 test files in tests/phpunit/tests/icons/ have been updated:
tests/phpunit/tests/icons/wpIconCollectionsRegistry.php:data_valid_collection_slugs()data_invalid_collection_slugs()data_boolean_public_properties()data_non_boolean_public_properties()
tests/phpunit/tests/icons/wpIconsRegistry.php:data_valid_icon_names()data_invalid_icon_names()data_sanitize_icon_content()data_invalid_icon_files()data_invalid_keywords()data_get_admin_icon_name_for_dashicon_without_replacement()
tests/phpunit/tests/icons/wpRestIconCollectionsController.php:data_non_public_collections()
tests/phpunit/tests/icons/wpRestIconsController.php:data_icon_visibility_searches()data_non_public_collection_requests()
All other files in tests/phpunit/tests/icons/ either have no data providers or are already static, making the entire icons/ directory 100% compliant with static data provider requirements.
Testing Instructions
Run the icons test suite locally:
php vendor/phpunit/phpunit/phpunit --filter "Tests_Icons|Tests_REST_WpRestIcon" vendor/bin/phpcs tests/phpunit/tests/icons/
Verification
- PHPUnit: OK (181 tests, 647 assertions)
- PHPCS: OK (7 files checked, 0 errors, 0 warnings)
---
Use of AI Tools
- Tool: Google Antigravity
- Model: Gemini 2.5 Pro
- Assistance: Code search, batch directory analysis, automated regex replacement for static keyword declarations, and test verification execution.
@shailu25 commented on PR #15117:
3 weeks ago
#170
@rejaulalomkhan Thanks for the PR.
Can you please apply Copilot’s suggestion?
@lancewillett commented on PR #14966:
3 weeks ago
#172
PR #14966 landed in https://core.trac.wordpress.org/changeset/64991
@lancewillett commented on PR #14968:
3 weeks ago
#173
PR #14968 landed in https://core.trac.wordpress.org/changeset/64991
@lancewillett commented on PR #14969:
3 weeks ago
#174
PR #14969 landed in https://core.trac.wordpress.org/changeset/64991
@lancewillett commented on PR #15118:
3 weeks ago
#175
PR #15118 landed in https://core.trac.wordpress.org/changeset/64991
This ticket was mentioned in PR #15135 on WordPress/wordpress-develop by @rejaulalomkhan.
3 weeks ago
#176
Description
Under Trac ticket #66211 and following committer guidance (Trac #66211 comment 109) to consolidate changes per directory rather than per file, this PR updates all data provider methods across the entire tests/phpunit/tests/connectors/ test directory to be public static.
In PHPUnit 10+, data provider methods are required to be declared as static. Converting them to public static ensures forward compatibility while preserving existing test semantics and data sets.
Changes Included
The following 3 test files in tests/phpunit/tests/connectors/ have been updated:
tests/phpunit/tests/connectors/wpConnectorRegistry.php:data_application_password_external_name_keys()
tests/phpunit/tests/connectors/wpConnectorsMaskApiKey.php:data_mask_api_key()
tests/phpunit/tests/connectors/wpConnectorsRestSettingsDispatch.php:data_settings_route_spellings()data_settings_rest_route_query_values()
All other files in tests/phpunit/tests/connectors/ contain no data providers, making the entire connectors/ directory 100% compliant with static data provider requirements.
Testing Instructions
Run the connectors test suite locally:
php vendor/phpunit/phpunit/phpunit --filter Tests_Connectors vendor/bin/phpcs tests/phpunit/tests/connectors/
Verification
- PHPUnit: OK (120 tests, 302 assertions)
- PHPCS: OK (11 files checked, 0 errors, 0 warnings)
---
Use of AI Tools
- Tool: Google Antigravity
- Model: Gemini 2.5 Pro
- Assistance: Code search, batch directory analysis, automated regex replacement for static keyword declarations, and test verification execution.
@rejaulalomkhan commented on PR #15117:
3 weeks ago
#177
Thanks for the review, @shail-mehta! Updated in a51ccc7ab4 to make provider_test_passing_non_menu_object_to_converter_returns_wp_error() public and static as suggested.
@rejaulalomkhan commented on PR #15104:
3 weeks ago
#178
Closing in favor of #14907 which covers the full rest-api/ directory consolidation. Thanks @mukeshpanchal27!
This ticket was mentioned in PR #15153 on WordPress/wordpress-develop by @therssoftware.
3 weeks ago
#179
Tests: Make load data providers static.
Declare 5 data providers across tests/phpunit/tests/load/ as public static for compatibility with newer PHPUnit versions. Preserve existing datasets and assertions.
See #66211.
This ticket was mentioned in PR #15154 on WordPress/wordpress-develop by @devmuhib.
3 weeks ago
#180
Description
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/interactivity-api/ to be public static.
In PHPUnit 10+, data provider methods are required to be declared as static. Converting them to public static ensures forward compatibility while preserving existing test semantics and data sets.
Changes Included
The following test files in tests/phpunit/tests/interactivity-api/ have been updated:
tests/phpunit/tests/interactivity-api/wpInteractivityAPI-wp-bind.php:data_non_finite_values()data_json_serializable_values()(and declared helperget_json_serializable()asprivate static)data_non_scalar_values()
tests/phpunit/tests/interactivity-api/wpInteractivityAPIFunctions.php:data_wp_interactivity_data_wp_context_with_different_arrays()data_wp_interactivity_data_wp_context_with_different_arrays_and_a_namespace()data_wp_interactivity_data_wp_context_with_json_flags()
All other files in tests/phpunit/tests/interactivity-api/ already had static data providers or none, making the entire directory 100% compliant with static data provider requirements.
Testing Instructions
Run PHPUnit and PHPCS on the interactivity-api test suite:
vendor/bin/phpunit --filter "Tests_.*Interactivity_API" vendor/bin/phpcs tests/phpunit/tests/interactivity-api/
Verification
- PHPUnit: OK (439 tests, 1203 assertions)
- PHPCS: OK (12 files checked, 0 errors, 0 warnings)
---
Use of AI Tools
- Tool: Google Antigravity
- Model: Gemini 2.5 Pro
- Assistance: Code search, batch directory analysis, static keyword conversion, and test verification execution.
This ticket was mentioned in PR #15155 on WordPress/wordpress-develop by @devmuhib.
3 weeks ago
#181
Description
Under Trac ticket #66211 and following committer guidance (Trac #66211 comment 109) to consolidate changes per directory, this PR updates all data provider methods across tests/phpunit/tests/entity-fields/ to be public static.
In PHPUnit 10+, data provider methods are required to be declared as static. Converting them to public static ensures forward compatibility while preserving existing test semantics and data sets.
Changes Included
The following test files in tests/phpunit/tests/entity-fields/ have been updated:
tests/phpunit/tests/entity-fields/wpPreloadEntityFields.php:data_site_editor_screens()data_non_array_paths()
tests/phpunit/tests/entity-fields/wpRegisterCoreFieldCollections.php:data_default_fields_of_every_post_type()data_default_fields_and_their_supports()
All other files in tests/phpunit/tests/entity-fields/ do not declare data providers, making the entire directory 100% compliant with static data provider requirements.
Testing Instructions
Run PHPUnit and PHPCS on the entity-fields test suite:
vendor/bin/phpunit --filter "Tests_Entity_Fields_" vendor/bin/phpcs tests/phpunit/tests/entity-fields/
Verification
- PHPUnit: OK (99 tests, 341 assertions)
- PHPCS: OK (6 files checked, 0 errors, 0 warnings)
---
Use of AI Tools
- Tool: Google Antigravity
- Model: Gemini 2.5 Pro
- Assistance: Code search, batch directory analysis, static keyword conversion, and test verification execution.
This ticket was mentioned in PR #15156 on WordPress/wordpress-develop by @devmuhib.
3 weeks ago
#182
Description
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/block-supports/ to be public static.
In PHPUnit 10+, data provider methods are required to be declared as static. Converting them to public static ensures forward compatibility while preserving existing test semantics and data sets.
Changes Included
The following test file in tests/phpunit/tests/block-supports/ has been updated:
tests/phpunit/tests/block-supports/states.php:data_state_styles_that_paint_their_own_background()data_base_clips_that_are_not_text()data_empty_state_clips()data_build_state_selector_with_block_name()data_registered_block_selectors_scope_to_their_own_element()
All other test files in tests/phpunit/tests/block-supports/ were already static or declare no data providers, making the entire directory 100% compliant with static data provider requirements.
Testing Instructions
Run PHPUnit and PHPCS on the block-supports test suite:
vendor/bin/phpunit --filter "Tests_Block_Supports_" vendor/bin/phpcs tests/phpunit/tests/block-supports/
Verification
- PHPUnit: OK (505 tests, 696 assertions)
- PHPCS: OK (13 files checked, 0 errors, 0 warnings)
---
Use of AI Tools
- Tool: Google Antigravity
- Model: Gemini 2.5 Pro
- Assistance: Code search, batch directory analysis, static keyword conversion, and test verification execution.
This ticket was mentioned in PR #15157 on WordPress/wordpress-develop by @devmuhib.
3 weeks ago
#183
Description
Under Trac ticket #66211 and following committer guidance (Trac #66211 comment 109) to consolidate changes per directory, this PR updates all data provider methods across tests/phpunit/tests/menu/ to be public static.
In PHPUnit 10+, data provider methods are required to be declared as static. Converting them to public static ensures forward compatibility while preserving existing test semantics and data sets.
Changes Included
The following test files in tests/phpunit/tests/menu/ have been updated:
tests/phpunit/tests/menu/walker-nav-menu.php:data_start_el_with_empty_attributes()data_walker_nav_menu_start_el_should_add_rel_privacy_policy_to_privacy_policy_url()data_build_atts_should_build_attributes()
tests/phpunit/tests/menu/wpNavMenuRemoveMenuItemHasChildrenClass.php:data_menu_item_has_children_class_should_be_removed_or_retained_as_expected()
All other files in tests/phpunit/tests/menu/ do not declare data providers, making the entire directory 100% compliant with static data provider requirements.
Testing Instructions
Run PHPUnit and PHPCS on the menu test suite:
vendor/bin/phpunit --filter "Tests_Menu_|Tests_Nav_Menu_" vendor/bin/phpcs tests/phpunit/tests/menu/
Verification
- PHPUnit: OK (89 tests, 135 assertions)
- PHPCS: OK (11 files checked, 0 errors, 0 warnings)
---
Use of AI Tools
- Tool: Google Antigravity
- Model: Gemini 2.5 Pro
- Assistance: Code search, batch directory analysis, static keyword conversion, and test verification execution.
This ticket was mentioned in PR #15159 on WordPress/wordpress-develop by @devmuhib.
3 weeks ago
#184
Description
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/media/ to be public static.
In PHPUnit 10+, data provider methods are required to be declared as static. Converting them to public static ensures forward compatibility while preserving existing test semantics and data sets.
Changes Included
The following test files in tests/phpunit/tests/media/ have been updated:
tests/phpunit/tests/media/wpCrossOriginIsolation.php:data_cross_origin_elements()
tests/phpunit/tests/media/wpIsDocumentIsolationPolicySupported.php:data_user_agents()
All other test files in tests/phpunit/tests/media/ were already static or declare no data providers, making the entire directory 100% compliant with static data provider requirements.
Testing Instructions
Run PHPUnit and PHPCS on the media test suite:
vendor/bin/phpunit --filter "Tests_Media_wpCrossOriginIsolation|Tests_Media_wpIsDocumentIsolationPolicySupported" vendor/bin/phpcs tests/phpunit/tests/media/
Verification
- PHPUnit: OK (27 tests, 36 assertions)
- PHPCS: OK (12 files checked, 0 errors, 0 warnings)
---
Use of AI Tools
- Tool: Google Antigravity
- Model: Gemini 2.5 Pro
- Assistance: Code search, batch directory analysis, static keyword conversion, and test verification execution.
This ticket was mentioned in PR #15165 on WordPress/wordpress-develop by @rejaulalomkhan.
2 weeks ago
#185
Description
Under Trac ticket #66211 and following committer guidance (Trac #66211 comment 109) to consolidate changes per directory rather than per file, this PR updates all data provider methods across the entire tests/phpunit/tests/interactivity-api/ test directory to be public static.
In PHPUnit 10+, data provider methods are required to be declared as static. Converting them to public static ensures forward compatibility while preserving existing test semantics and test fixtures.
Changes Included
The following 2 test files in tests/phpunit/tests/interactivity-api/ have been updated:
tests/phpunit/tests/interactivity-api/wpInteractivityAPI-wp-bind.php:data_non_finite_values()data_json_serializable_values()(along with making helperget_json_serializable()static)data_non_scalar_values()
tests/phpunit/tests/interactivity-api/wpInteractivityAPIFunctions.php:data_wp_interactivity_data_wp_context_with_different_arrays()data_wp_interactivity_data_wp_context_with_different_arrays_and_a_namespace()data_wp_interactivity_data_wp_context_with_json_flags()
All remaining files in tests/phpunit/tests/interactivity-api/ either contain no data providers or are already static, making the entire interactivity-api/ directory 100% compliant with static data provider requirements.
Testing Instructions
Run the interactivity test suite locally:
php vendor/phpunit/phpunit/phpunit --filter "Tests_WP_Interactivity_API_WP_Bind|Tests_Interactivity_API_wpInteractivityAPIFunctions" vendor/bin/phpcs tests/phpunit/tests/interactivity-api/wpInteractivityAPI-wp-bind.php tests/phpunit/tests/interactivity-api/wpInteractivityAPIFunctions.php
Verification
- PHPUnit: OK (165 tests, 451 assertions)
- PHPCS: OK (2 files checked, 0 errors, 0 warnings)
---
Use of AI Tools
- Tool: Google Antigravity
- Model: Gemini 2.5 Pro
- Assistance: Code search, batch directory analysis, automated regex replacement for static keyword declarations, and test verification execution.
This ticket was mentioned in PR #15166 on WordPress/wordpress-develop by @rejaulalomkhan.
2 weeks ago
#186
Description
Under Trac ticket #66211 and following committer guidance (Trac #66211 comment 109) to consolidate changes per directory rather than per file, this PR updates all data provider methods across the entire tests/phpunit/tests/l10n/ test directory to be public static.
In PHPUnit 10+, data provider methods are required to be declared as static. Converting them to public static ensures forward compatibility while preserving existing test semantics and test fixtures.
Changes Included
The following 2 test files in tests/phpunit/tests/l10n/ have been updated:
tests/phpunit/tests/l10n/wpTextdomainRegistry.php:data_text_domains_sharing_a_prefix()data_domains_locales()
tests/phpunit/tests/l10n/wpTranslationsConvert.php:data_invalid_files()data_simple_example_files()data_export_matrix()
All remaining files in tests/phpunit/tests/l10n/ either contain no data providers or are already static, making the entire l10n/ directory 100% compliant with static data provider requirements.
Testing Instructions
Run the localization test suite locally:
php vendor/phpunit/phpunit/phpunit --filter "Tests_L10n_wpTextdomainRegistry|WP_Translation_Controller_Convert_Tests" vendor/bin/phpcs tests/phpunit/tests/l10n/wpTextdomainRegistry.php tests/phpunit/tests/l10n/wpTranslationsConvert.php
Verification
- PHPUnit: OK (65 tests, 330 assertions)
- PHPCS: OK (2 files checked, 0 errors, 0 warnings)
---
Use of AI Tools
- Tool: Google Antigravity
- Model: Gemini 2.5 Pro
- Assistance: Code search, batch directory analysis, automated regex replacement for static keyword declarations, and test verification execution.
This ticket was mentioned in PR #15167 on WordPress/wordpress-develop by @rejaulalomkhan.
2 weeks ago
#187
Description
Following #66211 and guidance from committer @lancewillett to consolidate static data provider updates by directory, this PR updates all data provider methods in tests/phpunit/tests/feed/ to be public static:
rss2.php:data_get_feed_build_date()rssEnclosure.php:data_rss_enclosure_with_multiline_enclosure_string(),data_rss_enclosure_with_non_valid_enclosure_string()wpSimplePieFile.php:data_header_parsing()
Testing Instructions
- Run PHPCS:
vendor/bin/phpcs tests/phpunit/tests/feed/rss2.php tests/phpunit/tests/feed/rssEnclosure.php tests/phpunit/tests/feed/wpSimplePieFile.php - Run PHPUnit:
vendor/bin/phpunit tests/phpunit/tests/feed/rss2.php tests/phpunit/tests/feed/rssEnclosure.php tests/phpunit/tests/feed/wpSimplePieFile.php
All tests pass cleanly.
---
This Pull Request is for code review only. Please keep all other discussion to the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.
Use of AI Tools
- Tool: Antigravity
- Model: Gemini 2.5 Pro
- Purpose: Identified non-static data providers across
tests/phpunit/tests/feed/and verified execution with PHPCS and PHPUnit.
This ticket was mentioned in PR #15168 on WordPress/wordpress-develop by @rejaulalomkhan.
2 weeks ago
#188
Description
Following #66211 and guidance from committer @lancewillett to consolidate static data provider updates by directory, this PR updates all data provider methods in tests/phpunit/tests/oembed/ to be public static:
wpFilterOembedIframeTitleAttributes.php:data_oembed_iframe_title_attribute()wpFilterOembedResult.php:data_wp_filter_pre_oembed_custom_result()
Testing Instructions
- Run PHPCS:
vendor/bin/phpcs tests/phpunit/tests/oembed/wpFilterOembedIframeTitleAttributes.php tests/phpunit/tests/oembed/wpFilterOembedResult.php - Run PHPUnit:
vendor/bin/phpunit --filter "Tests_oEmbed_wpFilterOembed"
All tests pass cleanly.
---
This Pull Request is for code review only. Please keep all other discussion to the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.
Use of AI Tools
- Tool: Antigravity
- Model: Gemini 2.5 Pro
- Purpose: Identified non-static data providers across
tests/phpunit/tests/oembed/and verified execution with PHPCS and PHPUnit.
This ticket was mentioned in PR #15169 on WordPress/wordpress-develop by @rejaulalomkhan.
2 weeks ago
#189
Description
Under Trac ticket #66211 and following committer guidance (Trac #66211 comment 109) to consolidate changes per directory rather than per file, this PR updates all data provider methods across the entire tests/phpunit/tests/feed/ test directory to be public static.
In PHPUnit 10+, data provider methods are required to be declared as static. Converting them to public static ensures forward compatibility while preserving existing test semantics and test fixtures.
Changes Included
The following 3 test files in tests/phpunit/tests/feed/ have been updated:
tests/phpunit/tests/feed/rss2.php:data_get_feed_build_date()
tests/phpunit/tests/feed/rssEnclosure.php:data_rss_enclosure_with_multiline_enclosure_string()data_rss_enclosure_with_non_valid_enclosure_string()
tests/phpunit/tests/feed/wpSimplePieFile.php:data_header_parsing()
All remaining files in tests/phpunit/tests/feed/ either contain no data providers or are already static, making the entire feed/ directory 100% compliant with static data provider requirements.
Testing Instructions
Run the feed test suite locally:
php vendor/phpunit/phpunit/phpunit --filter "Tests_Feed_RSS2|Tests_Feed_RssEnclosure|Tests_Feed_wpSimplePieFile" vendor/bin/phpcs tests/phpunit/tests/feed/rss2.php tests/phpunit/tests/feed/rssEnclosure.php tests/phpunit/tests/feed/wpSimplePieFile.php
Verification
- PHPUnit: OK (31 tests, 197 assertions)
- PHPCS: OK (3 files checked, 0 errors, 0 warnings)
---
Use of AI Tools
- Tool: Google Antigravity
- Model: Gemini 2.5 Pro
- Assistance: Code search, batch directory analysis, automated regex replacement for static keyword declarations, and test verification execution.
This ticket was mentioned in PR #15170 on WordPress/wordpress-develop by @rejaulalomkhan.
2 weeks ago
#190
Description
Following #66211 and guidance from committer @lancewillett to consolidate static data provider updates by directory, this PR updates all data provider methods in tests/phpunit/tests/theme/ to be public static:
registerThemeFeature.php:data_register_theme_support_validation()wpThemeJson.php:data_get_stylesheet_with_axial_block_gap()
Testing Instructions
- Run PHPCS:
vendor/bin/phpcs tests/phpunit/tests/theme/registerThemeFeature.php tests/phpunit/tests/theme/wpThemeJson.php - Run PHPUnit:
vendor/bin/phpunit --filter "Tests_Theme_RegisterThemeFeature"vendor/bin/phpunit --filter "test_get_stylesheet_generates_layout_styles_with_axial_block_gap"
All tests pass cleanly.
---
This Pull Request is for code review only. Please keep all other discussion to the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.
Use of AI Tools
- Tool: Antigravity
- Model: Gemini 2.5 Pro
- Purpose: Identified non-static data providers across
tests/phpunit/tests/theme/and verified execution with PHPCS and PHPUnit.
This ticket was mentioned in PR #15171 on WordPress/wordpress-develop by @rejaulalomkhan.
2 weeks ago
#191
Description
Under Trac ticket #66211 and following committer guidance (Trac #66211 comment 109) to consolidate changes per directory rather than per file, this PR updates all data provider methods across the entire tests/phpunit/tests/oembed/ test directory to be public static.
In PHPUnit 10+, data provider methods are required to be declared as static. Converting them to public static ensures forward compatibility while preserving existing test semantics and test fixtures.
Changes Included
The following 2 test files in tests/phpunit/tests/oembed/ have been updated:
tests/phpunit/tests/oembed/wpFilterOembedIframeTitleAttributes.php:data_oembed_iframe_title_attribute()
tests/phpunit/tests/oembed/wpFilterOembedResult.php:data_wp_filter_pre_oembed_custom_result()
All remaining files in tests/phpunit/tests/oembed/ either contain no data providers or are already static, making the entire oembed/ directory 100% compliant with static data provider requirements.
Testing Instructions
Run the oEmbed test suite locally:
php vendor/phpunit/phpunit/phpunit --filter "Tests_oEmbed_wpFilterOembedIframeTitleAttribute|Tests_oEmbed_wpFilterOembedResult" vendor/bin/phpcs tests/phpunit/tests/oembed/wpFilterOembedIframeTitleAttributes.php tests/phpunit/tests/oembed/wpFilterOembedResult.php
Verification
- PHPUnit: OK (23 tests, 33 assertions)
- PHPCS: OK (2 files checked, 0 errors, 0 warnings)
---
Use of AI Tools
- Tool: Google Antigravity
- Model: Gemini 2.5 Pro
- Assistance: Code search, batch directory analysis, automated regex replacement for static keyword declarations, and test verification execution.
This ticket was mentioned in PR #15172 on WordPress/wordpress-develop by @rejaulalomkhan.
2 weeks ago
#192
Description
Under Trac ticket #66211 and following committer guidance (Trac #66211 comment 109) to consolidate changes per directory rather than per file, this PR updates the remaining non-static data provider methods across the entire tests/phpunit/tests/theme/ test directory to be public static.
In PHPUnit 10+, data provider methods are required to be declared as static. Converting them to public static ensures forward compatibility while preserving existing test semantics and test fixtures.
Changes Included
The following 2 test files in tests/phpunit/tests/theme/ have been updated:
tests/phpunit/tests/theme/registerThemeFeature.php:data_register_theme_support_validation()
tests/phpunit/tests/theme/wpThemeJson.php:data_get_stylesheet_with_axial_block_gap()
With this PR, all 36 data provider methods across the entire tests/phpunit/tests/theme/ test directory are now public static.
Testing Instructions
Run the theme test suite locally:
php vendor/phpunit/phpunit/phpunit --filter "Tests_Theme_RegisterThemeFeature|Tests_Theme_wpThemeJson" vendor/bin/phpcs tests/phpunit/tests/theme/registerThemeFeature.php tests/phpunit/tests/theme/wpThemeJson.php
Verification
- PHPUnit: OK (357 tests, 723 assertions)
- PHPCS: OK (2 files checked, 0 errors, 0 warnings)
---
Use of AI Tools
- Tool: Google Antigravity
- Model: Gemini 2.5 Pro
- Assistance: Code search, batch directory analysis, declaring static data provider methods, and running technical test suites.
@rejaulalomkhan commented on PR #15169:
2 weeks ago
#193
Closing in favor of #15167.
@rejaulalomkhan commented on PR #15171:
2 weeks ago
#194
Closing in favor of #15168.
@rejaulalomkhan commented on PR #15172:
2 weeks ago
#195
Closing as duplicate of #15170 which already covers the theme directory.
This ticket was mentioned in PR #15173 on WordPress/wordpress-develop by @rejaulalomkhan.
2 weeks ago
#196
Description
Under Trac ticket #66211 and following committer guidance (Trac #66211 comment 109) to consolidate changes per directory rather than per file, this PR updates all remaining non-static data provider methods across the entire tests/phpunit/tests/html-api/ test directory to be public static.
In PHPUnit 10+, data provider methods are required to be declared as static. Converting them to public static ensures forward compatibility while preserving existing test semantics and test fixtures.
Changes Included
The following 3 test files in tests/phpunit/tests/html-api/ have been updated:
tests/phpunit/tests/html-api/wpHtmlProcessor-serialize.php:data_bogus_comments()data_processing_instructions()
tests/phpunit/tests/html-api/wpHtmlProcessor.php:data_html_processor_with_extended_next_token()
tests/phpunit/tests/html-api/wpHtmlProcessorWebPlatformTests.php:data_external_web_platform_tests()
With this PR, all 21 test files and ~90 data providers across the entire tests/phpunit/tests/html-api/ directory are now 100% compliant with static data provider requirements.
Testing Instructions
Run the HTML API test suite locally:
php vendor/phpunit/phpunit/phpunit --filter "Tests_HtmlApi_WpHtmlProcessor_Serialize|Tests_HtmlApi_WpHtmlProcessor|Tests_HtmlApi_WebPlatformTests" vendor/bin/phpcs tests/phpunit/tests/html-api/wpHtmlProcessor-serialize.php tests/phpunit/tests/html-api/wpHtmlProcessor.php tests/phpunit/tests/html-api/wpHtmlProcessorWebPlatformTests.php
Verification
- PHPUnit: OK (789 tests, 1954 assertions)
- PHPCS: OK (3 files checked, 0 errors, 0 warnings)
---
Use of AI Tools
- Tool: Google Antigravity
- Model: Gemini 2.5 Pro
- Assistance: Code search, batch directory analysis, converting remaining data providers to public static, and verifying tests locally.
This ticket was mentioned in PR #15175 on WordPress/wordpress-develop by @rejaulalomkhan.
2 weeks ago
#197
Description
Under Trac ticket #66211 and following committer guidance (Trac #66211 comment 109) to consolidate changes per directory rather than per file, this PR updates the remaining non-static data provider method in tests/phpunit/tests/fonts/ to be public static.
In PHPUnit 10+, data provider methods are required to be declared as static. Converting them to public static ensures forward compatibility while preserving existing test semantics and test fixtures.
Changes Included
The following test dataset file in tests/phpunit/tests/fonts/font-face/ has been updated:
tests/phpunit/tests/fonts/font-face/wp-font-face-tests-dataset.php:data_should_print_given_fonts()in traitWP_Font_Face_Tests_Datasets
With this PR, all 20 data provider methods across the entire tests/phpunit/tests/fonts/ test hierarchy (encompassing font-face and font-library) are now public static.
Testing Instructions
Run the fonts test suite locally:
php vendor/phpunit/phpunit/phpunit --filter "Tests_Fonts" vendor/bin/phpcs tests/phpunit/tests/fonts/font-face/wp-font-face-tests-dataset.php
Verification
- PHPUnit: OK (95 tests, 157 assertions)
- PHPCS: OK (1 file checked, 0 errors, 0 warnings)
---
Use of AI Tools
- Tool: Google Antigravity
- Model: Gemini 2.5 Pro
- Assistance: Code search, batch directory analysis, converting data providers to public static, and verifying tests locally.
This ticket was mentioned in PR #15176 on WordPress/wordpress-develop by @rejaulalomkhan.
2 weeks ago
#198
Description
Under Trac ticket #66211 and following committer guidance (Trac #66211 comment 109) to consolidate changes per directory rather than per file, this PR updates all data provider methods across the entire tests/phpunit/tests/pluggable/ test directory to be public static.
In PHPUnit 10+, data provider methods are required to be declared as static. Converting them to public static ensures forward compatibility while preserving existing test semantics and test fixtures.
Changes Included
The following test file in tests/phpunit/tests/pluggable/ has been updated:
tests/phpunit/tests/pluggable/wpRand.php:data_wp_rand_should_return_a_non_negative_integer()data_wp_rand_should_return_zero_when_min_and_max_are_zero()
All other test files in tests/phpunit/tests/pluggable/ contain no data providers, making the entire pluggable/ directory 100% compliant with static data provider requirements.
Testing Instructions
Run the pluggable test suite locally:
php vendor/phpunit/phpunit/phpunit tests/phpunit/tests/pluggable/wpRand.php tests/phpunit/tests/pluggable/wpMail.php vendor/bin/phpcs tests/phpunit/tests/pluggable/wpRand.php
Verification
- PHPUnit: OK (9 tests, 21 assertions)
- PHPCS: OK (1 file checked, 0 errors, 0 warnings)
---
Use of AI Tools
- Tool: Google Antigravity
- Model: Gemini 2.5 Pro
- Assistance: Code search, batch directory analysis, declaring static data provider methods, and running technical test suites.
@rejaulalomkhan commented on PR #15159:
2 weeks ago
#199
Thanks for working on this, @devmuhib009!
The data providers in wpCrossOriginIsolation.php and wpIsDocumentIsolationPolicySupported.php are properly declared as public static. Datasets are static and contain no instance references.
Tested locally against trunk with PHPCS and PHPUnit; all checks pass cleanly. Ready for merge.
This ticket was mentioned in PR #15177 on WordPress/wordpress-develop by @rejaulalomkhan.
2 weeks ago
#200
Description
Under Trac ticket #66211 and following committer guidance (Trac #66211 comment 109) to consolidate changes per directory rather than per file, this PR updates all remaining non-static data provider methods across the entire tests/phpunit/tests/customize/ test directory to be public static.
In PHPUnit 10+, data provider methods are required to be declared as static. Converting them to public static ensures forward compatibility while preserving existing test semantics and test fixtures.
Changes Included
The following test file in tests/phpunit/tests/customize/ has been updated:
tests/phpunit/tests/customize/widgets.php:data_customize_register_control_label_and_description()
With this PR, all data providers across the 14 test files in tests/phpunit/tests/customize/ (including custom-css-setting.php which was already static) are now 100% compliant with static data provider requirements.
Testing Instructions
Run the customize test suite locally:
php vendor/phpunit/phpunit/phpunit --filter "Tests_WP_Customize_Widgets" vendor/bin/phpcs tests/phpunit/tests/customize/widgets.php
Verification
- PHPUnit: OK (28 tests, 410 assertions)
- PHPCS: OK (1 file checked, 0 errors, 0 warnings)
---
Use of AI Tools
- Tool: Google Antigravity
- Model: Gemini 2.5 Pro
- Assistance: Code search, batch directory analysis, converting remaining data providers to public static, and verifying tests locally.
This ticket was mentioned in PR #15178 on WordPress/wordpress-develop by @rejaulalomkhan.
2 weeks ago
#201
Description
Under Trac ticket #66211 and following committer guidance (Trac #66211 comment 109) to consolidate changes per directory rather than per file, this PR updates all data provider methods across the entire tests/phpunit/tests/diff/ test directory to be public static.
In PHPUnit 10+, data provider methods are required to be declared as static. Converting them to public static ensures forward compatibility while preserving existing test semantics and test fixtures.
Changes Included
The following test file in tests/phpunit/tests/diff/ has been updated:
tests/phpunit/tests/diff/wpTextDiffRendererTable.php:data_compat_fields()
All other test files in tests/phpunit/tests/diff/ contain no data providers, making the entire diff/ directory 100% compliant with static data provider requirements.
Testing Instructions
Run the diff test suite locally:
php vendor/phpunit/phpunit/phpunit tests/phpunit/tests/diff/wpTextDiffRendererTable.php tests/phpunit/tests/diff/Text_Diff_Check_Test.php vendor/bin/phpcs tests/phpunit/tests/diff/wpTextDiffRendererTable.php
Verification
- PHPUnit: OK (19 tests, 25 assertions)
- PHPCS: OK (1 file checked, 0 errors, 0 warnings)
---
Use of AI Tools
- Tool: Google Antigravity
- Model: Gemini 2.5 Pro
- Assistance: Code search, batch directory analysis, converting data providers to public static, and verifying tests locally.
This ticket was mentioned in PR #15180 on WordPress/wordpress-develop by @rejaulalomkhan.
2 weeks ago
#202
Description
Under Trac ticket #66211 and following committer guidance (Trac #66211 comment 109) to consolidate changes per directory rather than per file, this PR updates all remaining non-static data provider methods across the entire tests/phpunit/tests/blocks/ test directory to be public static.
In PHPUnit 10+, data provider methods are required to be declared as static. Converting them to public static ensures forward compatibility while preserving existing test semantics and test fixtures.
This PR supersedes earlier single-file PR #14954 (which only covered register.php), consolidating the entire blocks/ directory into a single pull request.
Changes Included
The following 7 test files in tests/phpunit/tests/blocks/ have been updated:
tests/phpunit/tests/blocks/editor.php:data_get_default_block_editor_settings_auto_attach_media_enabled()data_block_editor_rest_api_preload_adds_missing_leading_slash()
tests/phpunit/tests/blocks/register.php:data_register_block_style_handle_uses_correct_core_stylesheet()data_register_block_registers_with_args_override_returns_false_when_name_is_missing()data_register_block_type_accepts_editor_script_array()data_register_block_type_throws_doing_it_wrong()data_register_block_style_name_contains_spaces()
tests/phpunit/tests/blocks/render.php:data_do_block_test_filenames()
tests/phpunit/tests/blocks/supportedStyles.php:data_get_block_wrapper_attributes_merge_or_override()
tests/phpunit/tests/blocks/wpBlock.php:data_provider_test_render_enqueues_scripts_and_styles()data_block_has_support_string()
tests/phpunit/tests/blocks/wpBlockParser.php:data_parsing_test_filenames()
tests/phpunit/tests/blocks/wpBlockType.php:data_block_version()
With this PR, all 31 test files across the entire tests/phpunit/tests/blocks/ directory are now 100% compliant with static data provider requirements.
Testing Instructions
Run the block test suites locally:
php vendor/phpunit/phpunit/phpunit tests/phpunit/tests/blocks/editor.php php vendor/phpunit/phpunit/phpunit tests/phpunit/tests/blocks/register.php php vendor/phpunit/phpunit/phpunit tests/phpunit/tests/blocks/render.php php vendor/phpunit/phpunit/phpunit tests/phpunit/tests/blocks/supportedStyles.php php vendor/phpunit/phpunit/phpunit tests/phpunit/tests/blocks/wpBlock.php php vendor/phpunit/phpunit/phpunit tests/phpunit/tests/blocks/wpBlockParser.php php vendor/phpunit/phpunit/phpunit tests/phpunit/tests/blocks/wpBlockType.php vendor/bin/phpcs tests/phpunit/tests/blocks/editor.php tests/phpunit/tests/blocks/register.php tests/phpunit/tests/blocks/render.php tests/phpunit/tests/blocks/supportedStyles.php tests/phpunit/tests/blocks/wpBlock.php tests/phpunit/tests/blocks/wpBlockParser.php tests/phpunit/tests/blocks/wpBlockType.php
Verification
- PHPUnit: OK (363 tests, 897 assertions across 7 files)
- PHPCS: OK (7 files checked, 0 errors, 0 warnings)
---
Use of AI Tools
- Tool: Google Antigravity
- Model: Gemini 2.5 Pro
- Assistance: Code search, batch directory analysis, converting remaining data providers to public static, and verifying tests locally.
@rejaulalomkhan commented on PR #14954:
2 weeks ago
#203
@lancewillett commented on PR #15117:
2 weeks ago
#205
PR #15117 landed in https://core.trac.wordpress.org/changeset/65006
@lancewillett commented on PR #15135:
2 weeks ago
#206
PR #15135 landed in https://core.trac.wordpress.org/changeset/65006
@lancewillett commented on PR #15154:
2 weeks ago
#207
PR #15154 landed in https://core.trac.wordpress.org/changeset/65006
@lancewillett commented on PR #15155:
2 weeks ago
#209
PR #15155 landed in https://core.trac.wordpress.org/changeset/65007
@lancewillett commented on PR #15157:
2 weeks ago
#210
PR #15157 landed in https://core.trac.wordpress.org/changeset/65007
@lancewillett commented on PR #15159:
2 weeks ago
#211
PR #15159 landed in https://core.trac.wordpress.org/changeset/65007
@lancewillett commented on PR #15167:
2 weeks ago
#212
PR #15167 landed in https://core.trac.wordpress.org/changeset/65007
@lancewillett commented on PR #15168:
2 weeks ago
#213
PR #15168 landed in https://core.trac.wordpress.org/changeset/65007
@lancewillett commented on PR #15170:
2 weeks ago
#214
PR #15170 landed in https://core.trac.wordpress.org/changeset/65007
@mukesh27 commented on PR #15165:
2 weeks ago
#215
Thanks for working on this, @rejaulalomkhan!
Commit f2d0059c32 (r65006) already made all of these providers static. That commit also made the get_json_serializable() helper static. This PR no longer applies to trunk, and no changes remain.
I think we can close this PR as a duplicate. Please reopen it if I missed something.
@mukesh27 commented on PR #15180:
2 weeks ago
#216
Thanks, @rejaulalomkhan! The changes look correct. I checked that no static provider or helper uses $this. The switch from array( $this, ... ) to array( __CLASS__, ... ) for the fixture callbacks also works, because the callbacks still run inside the class.
This PR needs a rebase. Commit f2d0059c32 (r65006) already made the 5 providers in tests/phpunit/tests/blocks/register.php static, so that file now conflicts. Please rebase on trunk and drop the register.php changes. The other 6 files apply cleanly.
@mukesh27 commented on PR #15176:
2 weeks ago
#217
Thanks, @rejaulalomkhan! The two changes in wpRand.php look good.
This PR misses one provider in this directory. get_defined_pluggable_functions() in tests/phpunit/tests/pluggable/signatures.php is a @dataProvider but is still non-static. Its body does not use $this, so it can become public static.
One test also calls it directly, at about line 60:
$defined = wp_list_pluck( $this->get_defined_pluggable_functions(), 0 );
This call still works after the change. For consistency, please update it to self::get_defined_pluggable_functions().
@lancewillett commented on PR #15098:
2 weeks ago
#219
PR #15098 landed in https://core.trac.wordpress.org/changeset/65027
@lancewillett commented on PR #15102:
2 weeks ago
#220
PR #15102 landed in https://core.trac.wordpress.org/changeset/65027
@lancewillett commented on PR #15153:
2 weeks ago
#221
PR #15153 landed in https://core.trac.wordpress.org/changeset/65027
@lancewillett commented on PR #14956:
2 weeks ago
#223
PR #14956 landed in https://core.trac.wordpress.org/changeset/65028
@lancewillett commented on PR #14959:
2 weeks ago
#224
PR #14959 landed in https://core.trac.wordpress.org/changeset/65028
@lancewillett commented on PR #14963:
2 weeks ago
#225
PR #14963 landed in https://core.trac.wordpress.org/changeset/65028
@lancewillett commented on PR #14908:
2 weeks ago
#227
PR #14908 landed in https://core.trac.wordpress.org/changeset/65029
@lancewillett commented on PR #14971:
2 weeks ago
#228
PR #14971 landed in https://core.trac.wordpress.org/changeset/65029
@lancewillett commented on PR #14972:
2 weeks ago
#229
PR #14972 landed in https://core.trac.wordpress.org/changeset/65029
@lancewillett commented on PR #14904:
2 weeks ago
#231
PR #14904 landed in https://core.trac.wordpress.org/changeset/65030
@lancewillett commented on PR #14905:
2 weeks ago
#232
PR #14905 landed in https://core.trac.wordpress.org/changeset/65030
@lancewillett commented on PR #14906:
2 weeks ago
#233
PR #14906 landed in https://core.trac.wordpress.org/changeset/65030
@lancewillett commented on PR #14907:
2 weeks ago
#235
PR #14907 landed in https://core.trac.wordpress.org/changeset/65031
@lancewillett commented on PR #15156:
2 weeks ago
#236
PR #15156 landed in https://core.trac.wordpress.org/changeset/65031
@lancewillett commented on PR #15166:
2 weeks ago
#237
PR #15166 landed in https://core.trac.wordpress.org/changeset/65031
@lancewillett commented on PR #15173:
2 weeks ago
#239
PR #15173 landed in https://core.trac.wordpress.org/changeset/65032
@lancewillett commented on PR #15175:
2 weeks ago
#240
PR #15175 landed in https://core.trac.wordpress.org/changeset/65032
@lancewillett commented on PR #15177:
2 weeks ago
#242
PR #15177 landed in https://core.trac.wordpress.org/changeset/65033
@lancewillett commented on PR #15178:
2 weeks ago
#243
PR #15178 landed in https://core.trac.wordpress.org/changeset/65033
@lancewillett commented on PR #15103:
2 weeks ago
#245
PR #15103 landed in https://core.trac.wordpress.org/changeset/65034
This ticket was mentioned in PR #15201 on WordPress/wordpress-develop by @shailu25.
2 weeks ago
#246
Trac ticket: #66211
What
Updates all data provider methods in tests/phpunit/tests/includes/ to public static.
Test-only; no production code changes.
Why
In PHPUnit 10+, data providers must be declared public static. Non-static providers are deprecated and will be removed in later PHPUnit versions. Making them static also avoids unnecessary test fixture setup before providers run.
How
In tests/phpunit/tests/includes/, convert remaining non-static data providers to public static:
factory.php:data_non_positive_object_ids(),data_term_taxonomy_sources(),data_legacy_retrieval_failures()helpers.php:data_assertSameSets(),data_assertSameSetsWithIndex(),data_die_process_input()uploadSnapshot.php:data_initial_uploads()
Existing datasets and assertions are unchanged.
Testing Instructions
npm run test:php -- --filter Tests_TestHelpersnpm run test:php -- --filter TestFactoryFornpm run test:php -- --filter Tests_Includes_UploadSnapshotnpm run test:php -- --filter Tests_TestHelpers -c tests/phpunit/multisite.xmlvendor/bin/phpcs tests/phpunit/tests/includes/factory.php tests/phpunit/tests/includes/helpers.php tests/phpunit/tests/includes/uploadSnapshot.php
Use of AI Tools
- Cursor
This ticket was mentioned in PR #15202 on WordPress/wordpress-develop by @shailu25.
2 weeks ago
#247
Trac ticket: #66211
What
Updates all data provider methods in tests/phpunit/tests/abilities-api/ to public static.
Test-only; no production code changes.
Why
In PHPUnit 10+, data providers must be declared public static. Non-static providers are deprecated and will be removed in later PHPUnit versions. Making them static also avoids unnecessary test fixture setup before providers run.
How
In tests/phpunit/tests/abilities-api/wpRegisterCoreContentAbility.php, convert all 29 non-static data providers to public static. Existing datasets and assertions are unchanged.
Testing Instructions
npm run test:php -- --filter Tests_Abilities_API_WpRegisterCoreContentAbilitynpm run test:php -- --filter Tests_Abilities_API_WpRegisterCoreContentAbility -c tests/phpunit/multisite.xmlnpm run test:php -- --filter Tests_Abilities_API_WpRegisterCoreContentAbility --order-by=randomvendor/bin/phpcs tests/phpunit/tests/abilities-api/wpRegisterCoreContentAbility.php
Use of AI Tools
- Cursor
#248
@
2 weeks ago
Here is a quick status update on the data provider conversion across trunk to help coordinate remaining work (as of trunk at d1406a35d9):
Current Progress:
- Total providers: 1,749 unique methods
- Already static on trunk: 1,570 (~90%)
- Remaining non-static: 179 (~10%)
- 49 providers across 5 open PRs (some draft, some awaiting refresh).
- 130 providers unclaimed and available.
- Of the 179 remaining, 18 use
$this(16 unclaimed, 2 handled in PR 15180); the other 161 only need thepublic staticsignature change.
In-Flight PRs (49 providers):
tests/phpunit/tests/abilities-api/(29) — PR 15202 (draft, checks passing)tests/phpunit/tests/includes/(7) — PR 15201 (draft, checks passing)tests/phpunit/tests/blocks/(8) — PR 15180 (needs refresh to dropregister.php, already committed in r65006)tests/phpunit/tests/pluggable/(3) — PR 15176 (covers 2 so far; needssignatures.phpadded and its direct provider call changed toself::)tests/phpunit/tests/block-bindings/patternOverridesSource.php(2) — PR 14970 (needs rebase after r64987, which removeddata_empty_context())
Available Subdirectories (Ready for PRs — 58 providers):
tests/phpunit/tests/link/(8 providers across 6 files) — No$thistests/phpunit/tests/wp/(4 providers across 2 files) — No$thistests/phpunit/tests/privacy/(3 providers inwpPrivacyProcessPersonalDataExportPage.php) — No$thistests/phpunit/tests/block-bindings/render.php(3 providers) — No$thistests/phpunit/tests/kses/(3 providers across 2 files) — No$thistests/phpunit/tests/sitemaps/(2 providers inwpSitemapsPosts.phpandwpSitemapsTaxonomies.php, added in r65043) — No$thistests/phpunit/tests/pomo/pluralForms.php(1 provider) — No$thistests/phpunit/tests/admin/wpAutomaticUpdater.php(1 provider) — No$thistests/phpunit/tests/user/(12 providers across 5 files; 3 incapabilities.phpuse$this)tests/phpunit/tests/image/(14 providers across 4 files; 7 infunctions.phpuse$this)tests/phpunit/tests/db/charset.php(7 providers; 3 use$this)
Available Root Test Files in tests/phpunit/tests/*.php (72 providers):
tests/db.php(14 providers) — No$thistests/rest-api.php(13 providers) — No$thistests/post.php(5 providers) — No$thistests/block-template.php(3 providers) — No$thistests/build-visual-html-tree.php(3 providers) — No$thistests/view-config.php(2 providers) — No$thistests/meta.php(1 provider) — No$thistests/vars.php(1 provider) — No$thistests/media.php(23 providers; 1 uses$this)tests/theme.php(4 providers; 1 uses$this)tests/template.php(3 providers; 1 uses$this)
This ticket was mentioned in PR #15213 on WordPress/wordpress-develop by @devmuhib.
2 weeks ago
#249
Description
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/link/ to be public static.
In PHPUnit 10+, data provider methods are required to be declared as static. Converting them to public static ensures forward compatibility while preserving existing test semantics and data sets.
Changes Included
The following 6 test files in tests/phpunit/tests/link/ have been updated:
tests/phpunit/tests/link/editTermLink.php:data_edit_term_link()
tests/phpunit/tests/link/getEditTermLink.php:data_get_edit_term_link()
tests/phpunit/tests/link/getFeedLink.php:data_plain_permastruct()data_pretty_permastruct()
tests/phpunit/tests/link/getPagenumLink.php:data_get_pagenum_link_plain_permalinks()data_get_pagenum_link()
tests/phpunit/tests/link/getThePostsNavigation.php:data_get_the_posts_navigation()
tests/phpunit/tests/link/themeFile.php:data_theme_files()
All other test files in tests/phpunit/tests/link/ were already declared public static or have no data providers, making the entire link/ test directory 100% compliant with static data provider requirements.
Testing Instructions
Run PHPUnit and PHPCS on the link test suite:
vendor/bin/phpunit --filter "Tests_Link_" vendor/bin/phpcs tests/phpunit/tests/link/
Verification
- PHPUnit: OK (447 tests, 680 assertions)
- PHPCS: OK (19 files checked, 0 errors, 0 warnings)
---
Use of AI Tools
- Tool: Google Antigravity
- Model: Gemini 2.5 Pro
- Assistance: Code search, directory analysis, static keyword declaration, and test verification execution.
This ticket was mentioned in PR #15214 on WordPress/wordpress-develop by @devmuhib.
2 weeks ago
#250
Description
Under Trac ticket #66211 and following committer guidance (Trac #66211 comment 109) to consolidate changes per directory, this PR updates all data provider methods across tests/phpunit/tests/wp/ to be public static.
In PHPUnit 10+, data provider methods are required to be declared as static. Converting them to public static ensures forward compatibility while preserving existing test semantics and data sets.
Changes Included
The following test files in tests/phpunit/tests/wp/ have been updated:
tests/phpunit/tests/wp/handle404.php:data_sitemap_requests()
tests/phpunit/tests/wp/handleRandom.php:data_requests_without_the_random_query_var()data_requests_that_are_not_random_content_requests()data_permalinks_that_cannot_be_redirected_to()
All other test files in tests/phpunit/tests/wp/ do not declare data providers, making the entire directory 100% compliant with static data provider requirements.
Testing Instructions
Run PHPUnit and PHPCS on the wp test suite:
vendor/bin/phpunit --filter "Tests_WP_Handle404|Tests_WP_HandleRandom" vendor/bin/phpcs tests/phpunit/tests/wp/
Verification
- PHPUnit: OK (25 tests, 62 assertions)
- PHPCS: OK (6 files checked, 0 errors, 0 warnings)
---
Use of AI Tools
- Tool: Google Antigravity
- Model: Gemini 2.5 Pro
- Assistance: Code search, directory analysis, static keyword conversion, and test verification execution.
This ticket was mentioned in PR #15215 on WordPress/wordpress-develop by @devmuhib.
2 weeks ago
#251
Description
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/sitemaps/ to be public static.
In PHPUnit 10+, data provider methods are required to be declared as static. Converting them to public static ensures forward compatibility while preserving existing test semantics and data sets.
Changes Included
The following test files in tests/phpunit/tests/sitemaps/ have been updated:
tests/phpunit/tests/sitemaps/wpSitemapsPosts.php:data_sitemap_does_not_404_for_valid_sitemap_subtypes()
tests/phpunit/tests/sitemaps/wpSitemapsTaxonomies.php:data_sitemap_does_not_404_for_valid_sitemap_subtypes()
All other data providers in tests/phpunit/tests/sitemaps/ were already declared as public static, making the entire sitemaps/ test directory 100% compliant with static data provider requirements.
Testing Instructions
Run PHPUnit and PHPCS on the sitemaps test suite:
vendor/bin/phpunit --filter "Tests_Sitemaps_" vendor/bin/phpcs tests/phpunit/tests/sitemaps/
Verification
- PHPUnit: OK (155 tests, 296 assertions)
- PHPCS: OK (10 files checked, 0 errors, 0 warnings)
---
Use of AI Tools
- Tool: Google Antigravity
- Model: Gemini 2.5 Pro
- Assistance: Code search, directory analysis, static keyword declaration, and test verification execution.
This ticket was mentioned in PR #15216 on WordPress/wordpress-develop by @devmuhib.
2 weeks ago
#252
Description
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/kses/ to be public static.
In PHPUnit 10+, data provider methods are required to be declared as static. Converting them to public static ensures forward compatibility while preserving existing test semantics and data sets.
Changes Included
The following test files in tests/phpunit/tests/kses/ have been updated:
tests/phpunit/tests/kses/wpFilterGlobalStylesPost.php:data_should_not_remove_safe_global_style_rules()
tests/phpunit/tests/kses/wpKsesHair.php:data_attribute_parsing()data_protocol_filtering()
All other test files in tests/phpunit/tests/kses/ were already declared as public static or have no data providers, making the entire kses/ test directory 100% compliant with static data provider requirements.
Testing Instructions
Run PHPUnit and PHPCS on the kses test suite:
vendor/bin/phpunit --filter "Tests_Kses_" vendor/bin/phpcs tests/phpunit/tests/kses/
Verification
- PHPUnit: OK (155 tests, 192 assertions)
- PHPCS: OK (9 files checked, 0 errors, 0 warnings)
---
Use of AI Tools
- Tool: Google Antigravity
- Model: Gemini 2.5 Pro
- Assistance: Code search, directory analysis, static keyword declaration, and test verification execution.
This ticket was mentioned in PR #15217 on WordPress/wordpress-develop by @devmuhib.
2 weeks ago
#253
Description
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/privacy/ to be public static.
In PHPUnit 10+, data provider methods are required to be declared as static. Converting them to public static ensures forward compatibility while preserving existing test semantics and data sets.
Changes Included
The following test file in tests/phpunit/tests/privacy/ has been updated:
tests/phpunit/tests/privacy/wpPrivacyProcessPersonalDataExportPage.php:data_wp_privacy_process_personal_data_export_page()data_send_as_email_options()data_export_page_status_transitions()
All other test files in tests/phpunit/tests/privacy/ were already declared as public static or have no data providers, making the entire privacy/ test directory 100% compliant with static data provider requirements.
Testing Instructions
Run PHPUnit and PHPCS on the privacy test suite:
vendor/bin/phpunit --filter "Tests_Privacy_" vendor/bin/phpcs tests/phpunit/tests/privacy/
Verification
- PHPUnit: OK (174 tests, 434 assertions)
- PHPCS: OK (13 files checked, 0 errors, 0 warnings)
---
Use of AI Tools
- Tool: Google Antigravity
- Model: Gemini 2.5 Pro
- Assistance: Code search, directory analysis, static keyword declaration, and test verification execution.
This ticket was mentioned in PR #15229 on WordPress/wordpress-develop by @devmuhib.
2 weeks ago
#254
Description
Under Trac ticket #66211 and following committer guidance (Trac #66211 comment 109) to consolidate changes per directory, this PR updates the remaining data provider method across tests/phpunit/tests/pomo/ to be public static.
In PHPUnit 10+, data provider methods are required to be declared as static. Converting them to public static ensures forward compatibility while preserving existing test semantics and data sets.
Changes Included
The following test file in tests/phpunit/tests/pomo/ has been updated:
tests/phpunit/tests/pomo/pluralForms.php:data_exceptions()
All other data providers across the pomo/ test directory were already declared as public static, making the entire pomo/ test suite 100% compliant with static data provider requirements.
Testing Instructions
Run PHPUnit and PHPCS on the POMO test suite:
vendor/bin/phpunit --filter "PluralFormsTest" vendor/bin/phpcs tests/phpunit/tests/pomo/
Use of AI Tools
AI assistance: Yes
Tool(s): Google Antigravity
Model(s): Gemini 3.8 Flash
Used for: Directory analysis, static keyword declaration, and local PHPUnit verification.
This ticket was mentioned in PR #15230 on WordPress/wordpress-develop by @devmuhib.
2 weeks ago
#255
Description
Under Trac ticket #66211 and following committer guidance (Trac #66211 comment 109) to consolidate changes per directory, this PR updates the remaining data provider method across tests/phpunit/tests/admin/ to be public static.
In PHPUnit 10+, data provider methods are required to be declared as static. Converting them to public static ensures forward compatibility while preserving existing test semantics and data sets.
Changes Included
The following test file in tests/phpunit/tests/admin/ has been updated:
tests/phpunit/tests/admin/wpAutomaticUpdater.php:data_has_fatal_error_should_record_fatal_error_details()
All other data providers across the admin/ test directory were already declared as public static, making the entire admin/ test suite 100% compliant with static data provider requirements.
Testing Instructions
Run PHPUnit and PHPCS on the admin test suite:
vendor/bin/phpunit --filter "Tests_Admin_WpAutomaticUpdater" vendor/bin/phpcs tests/phpunit/tests/admin/wpAutomaticUpdater.php
Use of AI Tools
AI assistance: Yes
Tool(s): Google Antigravity
Model(s): Gemini 3.8 Flash
Used for: Directory analysis, static keyword declaration, and local PHPUnit verification.
This ticket was mentioned in PR #15231 on WordPress/wordpress-develop by @devmuhib.
2 weeks ago
#256
Description
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 in tests/phpunit/tests/block-bindings/render.php to be public static.
In PHPUnit 10+, data provider methods are required to be declared as static. Converting them to public static ensures forward compatibility while preserving existing test semantics and data sets.
Changes Included
The following test file in tests/phpunit/tests/block-bindings/ has been updated:
tests/phpunit/tests/block-bindings/render.php:data_update_block_with_value_from_source()data_different_get_value_callbacks()data_rich_text_binding_preserves_nested_inner_blocks()
Testing Instructions
Run PHPUnit and PHPCS on the block-bindings test suite:
vendor/bin/phpunit --filter "WP_Block_Bindings_Render" vendor/bin/phpcs tests/phpunit/tests/block-bindings/render.php
Use of AI Tools
AI assistance: Yes
Tool(s): Google Antigravity
Model(s): Gemini 3.8 Flash
Used for: Directory analysis, static keyword declaration, and local PHPUnit verification.
This ticket was mentioned in PR #15232 on WordPress/wordpress-develop by @devmuhib.
2 weeks ago
#257
Description
Under Trac ticket #66211 and following committer guidance (Trac #66211 comment 109), this PR updates all data provider methods in tests/phpunit/tests/build-visual-html-tree.php to be public static.
In PHPUnit 10+, data provider methods are required to be declared as static. Converting them to public static ensures forward compatibility while preserving existing test semantics and data sets.
Changes Included
The following test file has been updated:
tests/phpunit/tests/build-visual-html-tree.php:data_build_equivalent_html_semantic_tree()data_build_equivalent_html_semantic_tree_with_equivalent_html()data_build_equivalent_html_semantic_tree_with_non_equivalent_html()
Testing Instructions
Run PHPUnit and PHPCS on the test file:
vendor/bin/phpunit --filter "Tests_Build_Equivalent_HTML_Semantic_Tree" vendor/bin/phpcs tests/phpunit/tests/build-visual-html-tree.php
Use of AI Tools
AI assistance: Yes
Tool(s): Google Antigravity
Model(s): Gemini 3.8 Flash
Used for: Code inspection, static keyword declaration, and local PHPUnit verification.
This ticket was mentioned in PR #15233 on WordPress/wordpress-develop by @devmuhib.
2 weeks ago
#258
Description
Under Trac ticket #66211 and following committer guidance (Trac #66211 comment 109), this PR updates all data provider methods in tests/phpunit/tests/block-template.php to be public static.
In PHPUnit 10+, data provider methods are required to be declared as static. Converting them to public static ensures forward compatibility while preserving existing test semantics and data sets.
Changes Included
The following test file has been updated:
tests/phpunit/tests/block-template.php:data_provider_skip_link_actions()data_get_block_theme_folders()data_get_block_templates_files_slugs()
Testing Instructions
Run PHPUnit and PHPCS on the test file:
vendor/bin/phpunit --filter "Tests_Block_Template" vendor/bin/phpcs tests/phpunit/tests/block-template.php
Use of AI Tools
AI assistance: Yes
Tool(s): Google Antigravity
Model(s): Gemini 3.8 Flash
Used for: Code inspection, static keyword declaration, and local PHPUnit verification.
This ticket was mentioned in PR #15234 on WordPress/wordpress-develop by @devmuhib.
2 weeks ago
#259
Description
Under Trac ticket #66211 and following committer guidance (Trac #66211 comment 109) to consolidate changes per directory/file, this PR updates all 7 data provider methods across tests/phpunit/tests/db/charset.php to be public static.
In PHPUnit 10+, data provider methods are required to be declared as static. Converting them to public static ensures forward compatibility while preserving existing test semantics and data sets.
Changes Included
The following test file has been updated:
tests/phpunit/tests/db/charset.php:data_strip_invalid_text()data_process_field_charsets()data_get_table_charset()data_get_column_charset()data_strip_invalid_text_from_query()data_dont_strip_text_from_schema_queries()data_table_collation_check()
To support static provider execution:
- Converted
$table_and_column_defsproperty toprotected staticand accessed it viaself::$table_and_column_defs. - Used
self::assertNotSame()andself::assertSame()insidedata_strip_invalid_text().
Testing Instructions
Run PHPUnit and PHPCS on the test file:
vendor/bin/phpunit --filter "Tests_DB_Charset" vendor/bin/phpcs tests/phpunit/tests/db/charset.php
Use of AI Tools
AI assistance: Yes
Tool(s): Google Antigravity
Model(s): Gemini 3.8 Flash
Used for: Refactoring instance property and assertions to static, and local PHPUnit verification.
This ticket was mentioned in PR #15235 on WordPress/wordpress-develop by @devmuhib.
2 weeks ago
#260
Description
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/user/ to be public static.
In PHPUnit 10+, data provider methods are required to be declared as static. Converting them to public static ensures forward compatibility while preserving existing test semantics and data sets.
Changes Included
The following 5 test files in tests/phpunit/tests/user/ have been updated:
tests/phpunit/tests/user/wpListUsers.php:data_should_create_a_user_list()data_should_not_create_a_user_list()
tests/phpunit/tests/user/queryCache.php:data_query_cache()
tests/phpunit/tests/user/newUserEmailAdminNotice.php:data_multisite_admin_notice_actions()
tests/phpunit/tests/user/mapMetaCap.php:data_meta_caps_throw_doing_it_wrong_without_required_argument_provided()
tests/phpunit/tests/user/capabilities.php:data_single_site_roles_to_check()data_user_with_role_can_edit_own_post()data_user_with_role_can_edit_others_posts()data_authorless_post()data_block_caps()- Converted internal helper methods (
_getSingleSitePrimitiveCaps(),_getMultiSitePrimitiveCaps(),getPrimitiveCapsAndRoles()) to static.
All other test files in tests/phpunit/tests/user/ were already declared as public static or have no data providers, making the entire user/ test directory 100% compliant with static data provider requirements.
Testing Instructions
Run PHPUnit and PHPCS on the user test suite:
vendor/bin/phpunit --filter "Tests_User_" vendor/bin/phpcs tests/phpunit/tests/user/
Use of AI Tools
AI assistance: Yes
Tool(s): Google Antigravity
Model(s): Gemini 3.8 Flash
Used for: Directory analysis, static conversion and helper refactoring, and local PHPUnit verification.
This ticket was mentioned in PR #15236 on WordPress/wordpress-develop by @devmuhib.
2 weeks ago
#261
Description
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/image/ to be public static.
In PHPUnit, data provider methods are executed before the test class is instantiated and should be declared as public static to avoid deprecated dynamic static calls in PHPUnit 10+.
Changes Included
- Converted all remaining data provider methods in
tests/phpunit/tests/image/topublic static:tests/phpunit/tests/image/functions.php:get_image_editor_engine_classes()helper converted toprivate static.data_image_editor_engine_classes()converted topublic staticusingself::text_array_to_dataprovider().data_file_is_valid_image_positive()converted topublic static.data_file_is_valid_image_negative()converted topublic static.data_file_is_displayable_image_positive()converted topublic static.data_file_is_displayable_image_negative()converted topublic static.data_wp_save_image_file()converted topublic static.data_wp_image_editor_should_respect_image_edit_thumbnails_separately_filters()converted topublic static.data_inferred_mime_types_when_saving_an_image()converted topublic static.data_wp_exif_frac2dec()converted topublic static.
tests/phpunit/tests/image/size.php:data_constrain_size_for_editor_invalid_size()converted topublic static.
tests/phpunit/tests/image/editor.php:data_wp_get_webp_info()converted topublic static.data_wp_get_avif_info()converted topublic static.
tests/phpunit/tests/image/editorGd.php:data_crop()converted topublic static.data_crop_invalid_dimensions()converted topublic static.
Testing Instructions
- Run PHPCS across the modified files:
vendor/bin/phpcs tests/phpunit/tests/image/
- Run single site and multisite PHPUnit test suites:
vendor/bin/phpunit --filter "Tests_Image_" vendor/bin/phpunit -c tests/phpunit/multisite.xml --filter "Tests_Image_"
- Verify all tests pass with zero failures or errors.
Use of AI Tools
AI assistance: Yes
Tool(s): Google Antigravity
Model(s): Gemini 3.8 Flash
Used for: Identifying data provider methods across the image test directory, verifying compatibility, and running the PHPUnit/PHPCS test suites.
@devmuhib commented on PR #15235:
2 weeks ago
#262
Thanks for the review @huzaifaalmesbah! Updated in commit 95a92f6341:
- Converted
dataAllCapsAndRoles()topublic static, along with its helper methodsgetAllCapsAndRoles(),getMetaCapsAndRoles(),_getSingleSiteMetaCaps(), and_getMultiSiteMetaCaps(). - Converted
dataTaxonomies()topublic static. - All tests pass cleanly on both single-site (765 tests, 2949 assertions) and multisite (775 tests, 3183 assertions).
@lancewillett commented on PR #15201:
2 weeks ago
#264
PR #15201 landed in https://core.trac.wordpress.org/changeset/65067
@lancewillett commented on PR #15202:
2 weeks ago
#265
PR #15202 landed in https://core.trac.wordpress.org/changeset/65067
@lancewillett commented on PR #15213:
2 weeks ago
#266
PR #15213 landed in https://core.trac.wordpress.org/changeset/65067
@lancewillett commented on PR #15214:
2 weeks ago
#268
PR #15214 landed in https://core.trac.wordpress.org/changeset/65068
@lancewillett commented on PR #15215:
2 weeks ago
#269
PR #15215 landed in https://core.trac.wordpress.org/changeset/65068
@lancewillett commented on PR #15216:
2 weeks ago
#270
PR #15216 landed in https://core.trac.wordpress.org/changeset/65068
@lancewillett commented on PR #15217:
2 weeks ago
#272
PR #15217 landed in https://core.trac.wordpress.org/changeset/65069
@lancewillett commented on PR #15229:
2 weeks ago
#273
PR #15229 landed in https://core.trac.wordpress.org/changeset/65069
@lancewillett commented on PR #15230:
2 weeks ago
#274
PR #15230 landed in https://core.trac.wordpress.org/changeset/65069
@lancewillett commented on PR #15231:
2 weeks ago
#276
PR #15231 landed in https://core.trac.wordpress.org/changeset/65070
@lancewillett commented on PR #15232:
2 weeks ago
#277
PR #15232 landed in https://core.trac.wordpress.org/changeset/65070
@lancewillett commented on PR #15233:
2 weeks ago
#278
PR #15233 landed in https://core.trac.wordpress.org/changeset/65070
@lancewillett commented on PR #15234:
2 weeks ago
#282
PR #15234 landed in https://core.trac.wordpress.org/changeset/65071
@lancewillett commented on PR #15235:
2 weeks ago
#283
PR #15235 landed in https://core.trac.wordpress.org/changeset/65073
@lancewillett commented on PR #15236:
2 weeks ago
#284
PR #15236 landed in https://core.trac.wordpress.org/changeset/65074
This ticket was mentioned in PR #15270 on WordPress/wordpress-develop by @shailu25.
2 weeks ago
#285
Trac ticket: #66211
What
Makes remaining data provider methods in these root test files public static:
tests/phpunit/tests/post.php(5)tests/phpunit/tests/view-config.php(2)tests/phpunit/tests/db.php(14)
Why
PHPUnit 10+ requires data providers to be public static. These providers only return datasets and do not use $this, so the signature change is enough.
How
Update the listed providers to public static. Datasets and assertions are unchanged.
tests/phpunit/tests/post.php:
data_stick_post_does_not_duplicate_post_ids()data_stick_post_with_unexpected_sticky_posts_option()data_unstick_post_removes_duplicate_post_ids()data_wp_insert_post_handle_malformed_post_date()data_wp_resolve_post_date_regex()
tests/phpunit/tests/view-config.php:
data_default_form_post_types()data_post_types_with_own_form()
tests/phpunit/tests/db.php:
data_esc_like()data_like_query()data_prepare_incorrect_arg_count()data_get_col()data_get_table_from_query()data_get_table_from_query_false()data_get_escaped_table_from_show_query()data_process_field_formats()data_process_single_field_invalid_data()data_process_multiple_fields_invalid_data()data_prepare_with_placeholders()data_prepare_should_respect_the_allow_unsafe_unquoted_parameters_property()data_escape_and_prepare()data_parse_db_host()
Testing Instructions
npm run test:php -- --filter Tests_Postnpm run test:php -- --filter Tests_View_Confignpm run test:php -- --filter Tests_DBnpm run test:php -- --filter "Tests_Post|Tests_View_Config|Tests_DB" --order-by=random
Use of AI Tools
- Cursor
@rejaulalomkhan commented on PR #15176:
2 weeks ago
#286
@mukeshpanchal27 @lancewillett get_defined_pluggable_functions() is now public static, and test_all_pluggable_functions_exist() calls it with self:: (545b066). The pluggable group passes on single site and multisite, including the 66 signature tests. I also corrected the description, which wrongly said the other files had no providers.
@rejaulalomkhan commented on PR #14970:
2 weeks ago
#287
@lancewillett Merged trunk (f86841c). The file now matches trunk apart from data_empty_metadata_names() and data_override_values_and_types() becoming static; the r64987 cleanup and datasets are unchanged, and test_get_value_returns_null_when_context_empty() has no provider.
@rejaulalomkhan commented on PR #15180:
2 weeks ago
#288
@mukeshpanchal27 @lancewillett Merged trunk (f36c601). register.php dropped out of the diff since r65006 made the same change, so the PR now covers the other six files. I updated the description to match.
This ticket was mentioned in PR #15299 on WordPress/wordpress-develop by @rejaulalomkhan.
2 weeks ago
#289
What
Makes the remaining 13 data provider methods in tests/phpunit/tests/rest-api.php public static.
Why
PHPUnit 10+ requires data providers to be public static. These providers only return datasets and do not use $this, so updating their visibility and static modifier brings them into compliance with PHPUnit 10 requirements and aligns with the broader effort on #66211.
How
Update the following data provider methods to public static function:
data_jsonp_callback_check()data_rest_parse_date()data_rest_parse_date_force_utc()data_rest_parse_embed_param()data_rest_filter_response_by_context()data_rest_ensure_response_returns_instance_of_wp_rest_response()data_rest_is_object()data_rest_sanitize_object()data_rest_is_array()data_rest_sanitize_array()data_rest_is_integer()data_get_best_type_for_value()data_rest_preload_api_request_embeds_links()
Datasets, test logic, and assertions are unchanged.
Testing Instructions
Run single-site and multisite test suites:
vendor/bin/phpunit --filter Tests_REST_API vendor/bin/phpunit -c tests/phpunit/multisite.xml --filter Tests_REST_API vendor/bin/phpcs tests/phpunit/tests/rest-api.php
All 449 tests (962 assertions) pass on both suites with zero PHPCS errors.
Use of AI Tools
AI assistance: Yes
Tool: Antigravity
Model: Gemini 3.8 Flash
Used for: Static data provider conversion, local verification via PHPUnit/PHPCS, and PR description generation.
@lancewillett commented on PR #15299:
2 weeks ago
#292
PR #15299 landed in https://core.trac.wordpress.org/changeset/65127
@lancewillett commented on PR #14970:
2 weeks ago
#293
PR #14970 landed in https://core.trac.wordpress.org/changeset/65128
@lancewillett commented on PR #15176:
2 weeks ago
#294
PR #15176 landed in https://core.trac.wordpress.org/changeset/65128
@lancewillett commented on PR #15180:
2 weeks ago
#295
PR #15180 landed in https://core.trac.wordpress.org/changeset/65128
This ticket was mentioned in PR #15308 on WordPress/wordpress-develop by @rejaulalomkhan.
2 weeks ago
#296
Description
Declares data providers in tests/phpunit/tests/bookmark-template/ as public static for PHPUnit compatibility:
Tests_walk_bookmarks::data_walk_bookmarks()intests/phpunit/tests/bookmark-template/walkBookmarks.phpTests_wp_list_bookmarks::data_wp_list_bookmarks_categorized()intests/phpunit/tests/bookmark-template/wpListBookmarks.phpTests_wp_list_bookmarks::data_wp_list_bookmarks_uncategorized()intests/phpunit/tests/bookmark-template/wpListBookmarks.php
All data providers are pure data sets and do not rely on instance state.
Testing Instructions
- Run single site tests:
php ./vendor/bin/phpunit --filter Tests_walk_bookmarksphp ./vendor/bin/phpunit --filter Tests_wp_list_bookmarks - Run multisite tests:
php ./vendor/bin/phpunit -c tests/phpunit/multisite.xml --filter Tests_walk_bookmarksphp ./vendor/bin/phpunit -c tests/phpunit/multisite.xml --filter Tests_wp_list_bookmarks
Both test suites pass with 21 tests and 51 assertions.
---
Use of AI Tools
AI assistance: Yes
Tool(s): Google Antigravity
Model(s): Gemini 3.8 Flash
Used for: Identifying non-static data providers, converting them to public static, and verifying tests locally. I reviewed every line, ran the test suites, and take full responsibility for the changes.
This ticket was mentioned in PR #15309 on WordPress/wordpress-develop by @devmuhib.
2 weeks ago
#297
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 be public static.
What
Declare data provider methods as public static across tests/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.php
Why
PHPUnit 10+ requires data providers to be public static. These methods do not use $this and return static datasets, so declaring them public static prepares the test suite for modern PHPUnit versions without changing test behavior.
Testing Instructions
Run the test suite and coding standards check:
vendor/bin/phpunit tests/phpunit/tests/admin/includes/misc/ vendor/bin/phpunit -c tests/phpunit/multisite.xml tests/phpunit/tests/admin/includes/misc/ vendor/bin/phpcs tests/phpunit/tests/admin/includes/misc/
All tests pass cleanly.
This ticket was mentioned in PR #15310 on WordPress/wordpress-develop by @devmuhib.
2 weeks ago
#298
Under Trac ticket #66211 and following committer guidance (Trac #66211 comment 109), this PR updates data provider methods across single-test files in functions, media, meta, and vars to be public static.
What
Declare data provider methods as public static:
Tests_Functions__WpCheckExistingFileNames::data_wp_check_existing_file_names()intests/phpunit/tests/functions/_wpCheckExistingFileNames.phpTests_Media_GetMediaEmbeddedInContent::data_content()intests/phpunit/tests/media/getMediaEmbeddedInContent.phpTests_Meta::data_get_metadata_with_non_existent_object_id()intests/phpunit/tests/meta.phpTests_Vars::get_data_to_test_wp_is_mobile()intests/phpunit/tests/vars.php
Why
PHPUnit 10+ requires data providers to be public static. These methods do not use $this and return static datasets, so declaring them public static prepares the test suite for modern PHPUnit versions without changing test behavior.
Testing Instructions
Run the test suite and coding standards check:
vendor/bin/phpunit --filter "Tests_Functions__WpCheckExistingFileNames|Tests_Media_GetMediaEmbeddedInContent|Tests_Meta|Tests_Vars" vendor/bin/phpunit -c tests/phpunit/multisite.xml --filter "Tests_Functions__WpCheckExistingFileNames|Tests_Media_GetMediaEmbeddedInContent|Tests_Meta|Tests_Vars" vendor/bin/phpcs tests/phpunit/tests/functions/_wpCheckExistingFileNames.php tests/phpunit/tests/media/getMediaEmbeddedInContent.php tests/phpunit/tests/meta.php tests/phpunit/tests/vars.php
All tests pass cleanly.
This ticket was mentioned in PR #15311 on WordPress/wordpress-develop by @devmuhib.
2 weeks ago
#299
Under Trac ticket #66211 and following committer guidance (Trac #66211 comment 109) to consolidate changes per directory/file, this PR updates all remaining data provider methods across tests/phpunit/tests/media.php to be public static.
What
Declare 23 data provider methods and 2 static helpers as public static (or private static) in tests/phpunit/tests/media.php:
data_attachment_permalinks_based_on_parent_status()data_autoembed()data_get_filters_with_do_shortcode_callback()data_image_converted_to_other_format_has_correct_filename()data_image_with_existing_auto_sizes()data_provider_data_provider_to_test_wp_enqueue_img_auto_sizes_contain_css_fix()data_provider_fetchpriority_values()data_provider_to_test_wp_img_tag_add_auto_sizes()data_special_contexts_for_the_content()data_special_contexts_for_the_content_wp_get_loading_attr_default()data_wp_get_attachment_image_decoding_attr()data_wp_get_loading_attr_default()data_wp_get_loading_attr_default_before_and_no_loop()data_wp_get_loading_optimization_attributes_arbitrary_contexts()data_wp_get_loading_optimization_attributes_check_allowed_tags()data_wp_get_loading_optimization_attributes_header_context()data_wp_get_loading_optimization_attributes_min_required_attrs()data_wp_lazy_loading_enabled_context_defaults()data_wp_lazy_loading_enabled_tag_name_defaults()data_wp_maybe_add_fetchpriority_high_attr()data_wp_prepare_attachment_for_js_filesize()data_wp_prepare_attachment_for_js_filesize_falls_back_to_the_file()data_wp_prepare_attachment_for_js_unusable_full_size()- Made helper methods
get_width_height_for_high_priority()andget_insufficient_width_height_for_high_priority()private staticand called them viaself::.
Why
PHPUnit 10+ requires data providers to be public static. Declaring them static prepares the test suite for modern PHPUnit versions without altering test behavior or assertion coverage.
Testing Instructions
Run the test suite and coding standards check:
vendor/bin/phpunit --filter Tests_Media vendor/bin/phpunit -c tests/phpunit/multisite.xml --filter Tests_Media vendor/bin/phpcs tests/phpunit/tests/media.php
All 564 tests (1578 assertions) pass cleanly.
@lancewillett commented on PR #15270:
2 weeks ago
#301
PR #15270 landed in https://core.trac.wordpress.org/changeset/65162
@lancewillett commented on PR #15308:
2 weeks ago
#302
PR #15308 landed in https://core.trac.wordpress.org/changeset/65162
@lancewillett commented on PR #15309:
2 weeks ago
#303
PR #15309 landed in https://core.trac.wordpress.org/changeset/65162
@lancewillett commented on PR #15310:
2 weeks ago
#304
PR #15310 landed in https://core.trac.wordpress.org/changeset/65162
@lancewillett commented on PR #15311:
2 weeks ago
#305
PR #15311 landed in https://core.trac.wordpress.org/changeset/65162
This ticket was mentioned in PR #15438 on WordPress/wordpress-develop by @devmuhib.
12 days ago
#306
Updates data providers in Tests_Theme to be public static for modern PHPUnit compatibility.
This ticket was mentioned in PR #15439 on WordPress/wordpress-develop by @devmuhib.
12 days ago
#307
Updates data providers in Tests_Admin_IncludesUpdate to be public static for modern PHPUnit compatibility.
This ticket was mentioned in PR #15440 on WordPress/wordpress-develop by @devmuhib.
12 days ago
#308
Updates data provider in Tests_Admin_Language_Pack_Upgrader to be public static for modern PHPUnit compatibility.
This ticket was mentioned in PR #15441 on WordPress/wordpress-develop by @devmuhib.
12 days ago
#309
Updates data provider in Tests_Query_RandomContentRedirect to be public static for modern PHPUnit compatibility.
This ticket was mentioned in PR #15442 on WordPress/wordpress-develop by @devmuhib.
12 days ago
#310
Updates data providers in Tests_Template to be public static for modern PHPUnit compatibility.
This ticket was mentioned in PR #15730 on WordPress/wordpress-develop by @fozlerabbi48.
9 days ago
#311
Description
Declares data_wp_hoist_late_printed_styles() in tests/phpunit/tests/template.php as public static for modern PHPUnit compatibility.
Converts the inline assertion closures in the datasets to static function and updates assertion calls from $this->assert... to self::assert....
Testing Instructions
- Run single site tests:
npm run test:php -- --filter Tests_Template::test_wp_hoist_late_printed_styles - Run multisite tests:
npm run test:php -- --filter Tests_Template::test_wp_hoist_late_printed_styles -c tests/phpunit/multisite.xml
This ticket was mentioned in PR #15731 on WordPress/wordpress-develop by @fozlerabbi48.
9 days ago
#312
Description
Declares data_provider_default_themes() in tests/phpunit/tests/theme.php as public static for modern PHPUnit compatibility.
Refactors the $default_themes property in Tests_Theme to be protected static and updates internal accesses to use self::$default_themes.
Testing Instructions
- Run single site tests:
npm run test:php -- --filter Tests_Theme::test_year_in_readmenpm run test:php -- --filter Tests_Theme::test_version_consistency_in_package_jsonnpm run test:php -- --filter Tests_Theme::test_default_themes_are_included_in_new_files - Run multisite tests:
npm run test:php -- --filter Tests_Theme -c tests/phpunit/multisite.xml
This ticket was mentioned in PR #15732 on WordPress/wordpress-develop by @fozlerabbi48.
9 days ago
#313
Description
Declares the remaining data providers in tests/phpunit/tests/view-config.php as public static for modern PHPUnit compatibility:
Tests_View_Config_API::data_post_types_with_excerpt_in_form()Tests_View_Config_API::data_post_types_with_author_in_form()
Both providers are pure data sets and do not rely on instance state.
Testing Instructions
- Run single site tests:
npm run test:php -- --filter Tests_View_Config_API::test_excerpt_layout_shows_placeholder_if_emptynpm run test:php -- --filter Tests_View_Config_API::test_author_layout_shows_placeholder_if_empty - Run multisite tests:
npm run test:php -- --filter Tests_View_Config_API -c tests/phpunit/multisite.xml
This ticket was mentioned in PR #15733 on WordPress/wordpress-develop by @fozlerabbi48.
9 days ago
#314
Description
Declares Tests_wp_ajax_time_format::data_time_format() in tests/phpunit/tests/admin/includes/ajax-actions/wpAjaxTimeFormat.php as public static for modern PHPUnit compatibility.
The data provider returns a static dataset and does not rely on instance state.
Testing Instructions
- Run single site tests:
npm run test:php -- --filter Tests_wp_ajax_time_format - Run multisite tests:
npm run test:php -- --filter Tests_wp_ajax_time_format -c tests/phpunit/multisite.xml
This ticket was mentioned in PR #15734 on WordPress/wordpress-develop by @fozlerabbi48.
9 days ago
#315
Description
Declares Tests_PHPUnit_GroupFilters::data_group_argument_syntax() in tests/phpunit/tests/phpunit/groupFilters.php as public static for modern PHPUnit compatibility.
The data provider returns a static dataset and does not rely on instance state.
Testing Instructions
- Run single site tests:
npm run test:php -- --filter Tests_PHPUnit_GroupFilters - Run multisite tests:
npm run test:php -- --filter Tests_PHPUnit_GroupFilters -c tests/phpunit/multisite.xml
@lancewillett commented on PR #15730:
9 days ago
#317
PR #15730 landed in https://core.trac.wordpress.org/changeset/65313
@lancewillett commented on PR #15731:
9 days ago
#318
PR #15731 landed in https://core.trac.wordpress.org/changeset/65313
@lancewillett commented on PR #15732:
9 days ago
#319
PR #15732 landed in https://core.trac.wordpress.org/changeset/65313
@lancewillett commented on PR #15733:
9 days ago
#320
PR #15733 landed in https://core.trac.wordpress.org/changeset/65313
@lancewillett commented on PR #15734:
9 days ago
#321
PR #15734 landed in https://core.trac.wordpress.org/changeset/65313
@lancewillett commented on PR #15442:
9 days ago
#322
PR #15442 landed in https://core.trac.wordpress.org/changeset/65313
@lancewillett commented on PR #15438:
9 days ago
#323
PR #15438 landed in https://core.trac.wordpress.org/changeset/65313
#324
@
9 days ago
Following r65313, a scan of trunk shows only 4 remaining data providers across 3 test files that are not yet static.
All 4 are already covered by 3 open PRs, all reviewed and approved by mukesh27:
- PR 15439 covers
data_non_plugin_translation_updatesanddata_translation_update_selectionsintests/phpunit/tests/admin/includesUpdate.php. - PR 15440 covers
data_bulk_upgrade_resultsintests/phpunit/tests/admin/languagePackUpgrader.php. - PR 15441 covers
data_invalid_argumentsintests/phpunit/tests/query/randomContentRedirect.php.
Once these three land, all data providers across the PHPUnit test suite will be public static, completing the work for this ticket.
@lancewillett commented on PR #15439:
5 days ago
#326
PR #15439 landed in https://core.trac.wordpress.org/changeset/65400.
@lancewillett commented on PR #15440:
5 days ago
#327
PR #15440 landed in https://core.trac.wordpress.org/changeset/65400.
@lancewillett commented on PR #15441:
5 days ago
#328
PR #15441 landed in https://core.trac.wordpress.org/changeset/65400.
Makes the five PHPUnit data provider methods in
tests/phpunit/tests/meta/(isProtectedMeta.php,registerMeta.php)public static, per the migration described in the parent ticket #62004. PHPUnit 10 deprecated non-static data providers and PHPUnit 11 removed support for them entirely; PHPUnit 9 (used here) accepts static providers, so this can land ahead of the PHPUnit upgrade. None of the five providers reference$this, so this is a mechanical signature change with no behavior change — confirmed by running both affected test classes (Tests_Meta_isProtectedMeta,Tests_Meta_Register_Meta), both still fully green.Use of AI Tools
AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Sonnet 5
Used for: Implementation and PR description. Reviewed by irozum.