Make WordPress Core

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

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.

#2 @lancewillett
7 weeks ago

In 64010:

Tests: Make meta test data providers static.

Declare the five data providers in the meta tests static to prepare for newer PHPUnit versions. The providers do not depend on instance state, and their test data and assertions remain unchanged.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/13827

Props irozum.
See #66211.

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_domains
  • networkOption.php: data_network_id_parameter
  • option.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_option
  • sanitizeOption.php: data_sanitize_option, data_sanitize_option_upload_path, data_sanitize_option_permalink_structure
  • themeMods.php: data_theme_mod_default_value_with_percent_symbols
  • wpDetermineOptionAutoloadValue.php: data_values
  • wpPrimeOptionCaches.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 @therssoftware
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 @pablodiloreto
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_nonintegers
  • doAction.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/phpcs on 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 @pablodiloreto
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.

#9 @lancewillett
6 weeks ago

In 64081:

Tests: Make hook test data providers static.

Declare the four data providers in the WP_Hook::apply_filters() and WP_Hook::do_action() tests as public static for compatibility with newer PHPUnit versions. The providers return literal data and do not require instance state.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/13967

Props pablodiloreto.
See #66211.

​@lancewillett commented on ​PR #13967:


6 weeks ago
#11

Thanks, Pablo—and congratulations on your first contribution to WordPress Core! 🎉

#12 @mukesh27
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 function instead of public static function.
  • All of them are already public, so most need only the static keyword 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_callback
  • admin/includesPlugin.php: data_submenu_position
  • blocks/render.php, blocks/wpBlockParser.php
  • db/charset.php (5 providers)
  • dependencies/scripts.php
  • formatting/emoji.php, formatting/wpTexturize.php (3)
  • functions/wpTimezoneOverrideOffset.php
  • general/feedLinksExtra.php
  • image/functions.php (7)
  • interactivity-api/wpInteractivityAPI-wp-bind.php (2)
  • kses.php, media.php, template.php, theme.php
  • post/getPost.php, post/wpInsertPost.php (4)
  • rest-api/rest-post-meta-fields.php, rest-api/rest-term-meta-fields.php, rest-api/wpRestAbilitiesV1RunController.php
  • term/getTermLink.php
  • user.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(): Made public static.
    • data_invalid_slug_provider(): Made public static.
  • tests/phpunit/tests/abilities-api/wpAbility.php:
    • data_execute_input(): Made public static.
    • data_validate_input_top_level_required(): Made public static.
    • data_execute_callback(): Made public 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!

#16 @lancewillett
6 weeks ago

In 64087:

Tests: Make option test data providers static.

Declare the 14 data providers in the option tests as public static for compatibility with newer PHPUnit versions. Preserve all datasets and assertions.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/13956

Props therssoftware, mukesh27.
See #66211.

#18 @lancewillett
6 weeks ago

In 64088:

Tests: Make Abilities API test data providers static.

Declare five data providers as public static for compatibility with newer PHPUnit versions. Use an anonymous object for the instance-method callback dataset so it no longer depends on $this, preserving coverage of object-method callables.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/13975

Props huzaifaalmesbah.
See #66211.

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_image
  • wpAddGlobalStylesForBlocks.php: data_wp_get_block_name_from_theme_json_path
  • wpGetGlobalStylesheet.php: data_should_conditionally_include_font_sizes, data_should_not_conditionally_include_font_sizes
  • wpTheme.php: data_is_block_theme, data_get_file_path
  • wpThemeGetBlockPatterns.php: data_get_block_patterns
  • wpThemeHasThemeJson.php: data_theme_has_theme_json_reports_correctly
  • wpThemeJson.php:
    • data_get_property_value_should_return_string_for_invalid_paths_or_null_values
    • data_sanitize_for_block_with_style_variations
    • data_sanitize_with_invalid_style_variation
    • data_get_styles_for_block_with_style_variations
    • data_set_spacing_sizes
    • data_set_spacing_sizes_when_invalid
    • data_update_separator_declarations
    • data_update_button_width_declarations
    • data_custom_css_for_user_caps
    • data_process_blocks_custom_css
    • data_get_block_style_variation_selector
    • data_append_to_selector
    • data_prepend_to_selector
  • wpThemeJsonResolver.php:
    • data_has_same_registered_blocks_when_all_blocks_not_cached
    • data_has_same_registered_blocks_when_all_blocks_are_cached
    • data_get_core_data
    • data_get_merged_data_returns_origin
    • data_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: @therssoftware
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.

Version 0, edited 6 weeks ago by therssoftware (next)

#22 in reply to: ↑ 21 @mukesh27
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.

#24 @lancewillett
6 weeks ago

In 64104:

Tests: Make theme test data providers static.

Declare 28 data providers in the theme tests as public static for compatibility with newer PHPUnit versions. Preserve all datasets and assertions.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/14003

Props therssoftware, mukesh27.
See #66211.

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_validation
    • data_set_cron_array_returns_false_when_not_updated
    • data_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 @therssoftware
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.

#28 @lancewillett
6 weeks ago

  • Milestone Future Release → 7.2
  • Owner set to lancewillett
  • Status new → accepted

#29 @lancewillett
5 weeks ago

In 64262:

Tests: Make cron data providers static.

Declare the five data providers in tests/phpunit/tests/cron.php and tests/phpunit/tests/cron/ as public static for compatibility with newer PHPUnit versions. Preserve their datasets and assertions.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/14028

Props therssoftware, mukesh27.
See #66211.

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

  1. Run vendor/bin/phpcs tests/phpunit/tests/admin/
  2. Run vendor/bin/phpunit --group admin
  3. 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

  1. Run vendor/bin/phpcs tests/phpunit/tests/bookmark/
  2. 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

  1. Run vendor/bin/phpcs tests/phpunit/tests/sitemaps/
  2. 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

  1. Run vendor/bin/phpcs tests/phpunit/tests/comment/
  2. 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

  1. Run vendor/bin/phpcs tests/phpunit/tests/term/
  2. 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

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

All tests pass cleanly.

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

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 static across 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 static across 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 static across 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 static across 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.

#43 @lancewillett
4 weeks ago

In 64439:

Tests: Make formatting test data providers static.

Declare the data providers in tests/phpunit/tests/formatting/ as public static for compatibility with newer PHPUnit versions. Preserve their datasets and assertions. Use static properties for the emoji CDN fixture values.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/14381

Props rejaulalomkhan, mukesh27.
See #66211.

#45 @lancewillett
4 weeks ago

In 64440:

Tests: Make function test data providers static.

Declare the data providers in tests/phpunit/tests/functions/ as public static for compatibility with newer PHPUnit versions. Preserve their datasets and assertions. Make the daylight-saving-time helper static so the timezone provider does not require an instance.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/14382

Props rejaulalomkhan, huzaifaalmesbah.
See #66211.

#47 @lancewillett
4 weeks ago

In 64441:

Tests: Make admin test data providers static.

Declare the data providers in tests/phpunit/tests/admin/ as public static for compatibility with newer PHPUnit versions. Preserve their datasets and assertions. Update direct calls to the submenu provider to use self::.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/14389

Props rejaulalomkhan.
See #66211.

#49 @lancewillett
4 weeks ago

In 64442:

Tests: Make bookmark test data providers static.

Declare the data providers in tests/phpunit/tests/bookmark/ as public static for compatibility with newer PHPUnit versions. Preserve their datasets and assertions.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/14391

Props rejaulalomkhan.
See #66211.

#51 @lancewillett
4 weeks ago

In 64443:

Tests: Make sitemap test data providers static.

Declare the data providers in tests/phpunit/tests/sitemaps/ as public static for compatibility with newer PHPUnit versions. Preserve their datasets and assertions.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/14392

Props rejaulalomkhan.
See #66211.

#53 @lancewillett
4 weeks ago

In 64444:

Tests: Make comment test data providers static.

Declare the data providers in tests/phpunit/tests/comment/ as public static for compatibility with newer PHPUnit versions. Preserve their datasets and assertions.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/14393

Props rejaulalomkhan.
See #66211.

#55 @lancewillett
4 weeks ago

In 64445:

Tests: Make term test data providers static.

Declare the data providers in tests/phpunit/tests/term/ as public static for compatibility with newer PHPUnit versions. Preserve their datasets and assertions. Call the existing static text_array_to_dataprovider() helper with self::.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/14395

Props rejaulalomkhan.
See #66211.

#57 @lancewillett
4 weeks ago

In 64446:

Tests: Make compatibility test data providers static.

Declare the data providers in tests/phpunit/tests/compat/ as public static for compatibility with newer PHPUnit versions. Preserve their datasets and assertions.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/14396

Props rejaulalomkhan.
See #66211.

#59 @lancewillett
4 weeks ago

In 64447:

Tests: Make date test data providers static.

Declare the data providers in tests/phpunit/tests/date/ as public static for compatibility with newer PHPUnit versions. Preserve their datasets and assertions.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/14397

Props rejaulalomkhan.
See #66211.

#61 @lancewillett
4 weeks ago

In 64448:

Tests: Make font test data providers static.

Declare the data providers in tests/phpunit/tests/fonts/ as public static for compatibility with newer PHPUnit versions. Preserve their datasets and assertions.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/14400

Props rejaulalomkhan.
See #66211.

#63 @lancewillett
4 weeks ago

In 64449:

Tests: Make block support test data providers static.

Declare the data providers in tests/phpunit/tests/block-supports/ as public static for compatibility with newer PHPUnit versions. Preserve their datasets and assertions.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/14398

Props rejaulalomkhan.
See #66211.

#64 @lancewillett
4 weeks ago

In 64450:

Tests: Make canonical redirect test data providers static.

Declare the data providers in tests/phpunit/tests/canonical/ as public static for compatibility with newer PHPUnit versions. Preserve their datasets and assertions.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/14399

Props rejaulalomkhan.
See #66211.

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>

#72 @lancewillett
4 weeks ago

In 64505:

Tests: Make AJAX data providers static.

Declare the remaining data providers in the AJAX tests as public static for compatibility with newer PHPUnit versions. Preserve the datasets and assertions.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/14443

Props therssoftware.
See #66211.

#74 @lancewillett
4 weeks ago

In 64506:

Tests: Make HTTP data providers static.

Declare the remaining data providers in the HTTP tests as public static for compatibility with newer PHPUnit versions. Preserve the datasets and assertions.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/14440

Props therssoftware.
See #66211.

#76 @lancewillett
4 weeks ago

In 64507:

Tests: Make rewrite data providers static.

Declare the remaining data providers in the rewrite tests as public static for compatibility with newer PHPUnit versions. Preserve the datasets and assertions.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/14460

Props therssoftware.
See #66211.

#78 @lancewillett
4 weeks ago

In 64580:

Tests: Make media data providers static.

Declare ten data providers in tests/phpunit/tests/media/ as public static for compatibility with newer PHPUnit versions. Preserve their datasets and assertions.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/14462

Props therssoftware.
See #66211.

#80 @ravipatel
4 weeks ago

Taking tests/phpunit/tests/secrets/. PR coming shortly.

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 @ravipatel
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(), and data_compat_fields() to be declared as public 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() in buildBlockTemplateResultFromFile.php to public static function.
  • Updates data_get_template_hierarchy() in getTemplateHierarchy.php to public 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() in colors.php to public static function.
  • Updates data_render_duotone_support_invalid_attribute() in duotone.php to public 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() in tests/phpunit/tests/basic.php to public static function.
  • Updates data_remove_theme_attribute_in_block_template_content() in tests/phpunit/tests/block-template-utils.php to public 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

  1. 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).

  1. 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 --check pass.
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 --check passes.
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: @mukesh27
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() in Tests_Post_wpCountPosts from public function to public 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() to public static
  • Convert data_get_word_count_type() to public static

Test-only; no production code changes.

Testing Instructions

  1. npm run test:php -- --filter Tests_Locale
  2. npm run test:php -- --filter Tests_Locale -c tests/phpunit/multisite.xml
  3. npm run test:php -- --filter Tests_Locale --order-by=random
  4. npm 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() to public static
  • Convert data_wp_tempnam_should_limit_filename_length_to_252_characters() to public static

Test-only; no production code changes.

Testing Instructions

  1. npm run test:php -- --filter Tests_File
  2. npm run test:php -- --filter Tests_File -c tests/phpunit/multisite.xml
  3. npm run test:php -- --filter Tests_File --order-by=random
  4. npm 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() to public static

Test-only; no production code changes.

Testing Instructions

  1. npm run test:php -- --filter Tests_Category_Walker_Category
  2. npm run test:php -- --filter Tests_Category_Walker_Category -c tests/phpunit/multisite.xml
  3. npm run test:php -- --filter Tests_Category_Walker_Category --order-by=random
  4. npm 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() to public static

Test-only; no production code changes.

Testing Instructions

  1. npm run test:php -- --filter Tests_Dependencies_jQuery
  2. npm run test:php -- --filter Tests_Dependencies_jQuery -c tests/phpunit/multisite.xml
  3. npm run test:php -- --filter Tests_Dependencies_jQuery --order-by=random
  4. npm 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() to public static

Test-only; no production code changes.

Testing Instructions

  1. npm run test:php -- --filter Tests_Rewrite
  2. npm run test:php -- --filter Tests_Rewrite -c tests/phpunit/multisite.xml
  3. npm run test:php -- --filter Tests_Rewrite --order-by=random
  4. npm 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() to public static

Test-only; no production code changes.

Testing Instructions

  1. npm run test:php -- --filter Tests_Comment_GetLastCommentModified
  2. npm run test:php -- --filter Tests_Comment_GetLastCommentModified -c tests/phpunit/multisite.xml
  3. npm run test:php -- --filter Tests_Comment_GetLastCommentModified --order-by=random
  4. npm 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() to public static

Test-only; no production code changes.

Testing Instructions

  1. npm run test:php -- --filter Tests_DB_RealEscape
  2. npm run test:php -- --filter Tests_DB_RealEscape -c tests/phpunit/multisite.xml
  3. npm run test:php -- --filter Tests_DB_RealEscape --order-by=random
  4. npm 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() in Tests_Post_wpCountAttachments from public function to public 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() in Tests_Post_TruncatePostSlug from public function to public 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() to public static

Test-only; no production code changes.

Testing Instructions

  1. npm run test:php -- --filter Tests_Taxonomy
  2. npm run test:php -- --filter Tests_Taxonomy -c tests/phpunit/multisite.xml
  3. npm run test:php -- --filter Tests_Taxonomy --order-by=random
  4. npm 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() to public static
  • Convert data_priority_callback_order_with_unhappy_path_nonintegers() to public static

Test-only; no production code changes.

Testing Instructions

  1. npm run test:php -- --filter Tests_Filters
  2. npm run test:php -- --filter Tests_Filters -c tests/phpunit/multisite.xml
  3. npm 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() to public static
  • Convert data_get_term_filter() to public static

Test-only; no production code changes.

Testing Instructions

  1. npm run test:php -- --filter Tests_Term
  2. npm run test:php -- --filter Tests_Term -c tests/phpunit/multisite.xml
  3. npm run test:php -- --filter Tests_Term --order-by=random
  4. npm 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() to public static
  • Convert data_redirect_guess_404_permalink_with_custom_statuses() to public static
  • Convert data_redirect_guess_404_permalink_post_types() to public static
  • Convert data_canonical_attachment_page_redirect_with_option_disabled() to public static

Test-only; no production code changes.

Testing Instructions

  1. npm run test:php -- --filter Tests_Canonical
  2. npm run test:php -- --filter Tests_Canonical -c tests/phpunit/multisite.xml
  3. npm run test:php -- --filter Tests_Canonical --order-by=random
  4. npm 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() to public static
  • Convert data_escaping() to public static
  • Convert data_escaping2() to public static
  • Convert data_registration_bad() to public static
  • Convert data_registration_good() to public static
  • Convert data_whole_posts() to public static

Test-only; no production code changes.

Testing Instructions

  1. npm run test:php -- --filter Tests_Shortcode
  2. npm run test:php -- --filter Tests_Shortcode -c tests/phpunit/multisite.xml
  3. npm run test:php -- --filter Tests_Shortcode --order-by=random
  4. npm 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() to public static

Test-only; no production code changes.

Testing Instructions

  1. npm run test:php -- --filter Tests_Cache
  2. npm run test:php -- --filter Tests_Cache -c tests/phpunit/multisite.xml
  3. npm run test:php -- --filter Tests_Cache --order-by=random
  4. npm 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() to public static

Test-only; no production code changes.

Testing Instructions

  1. npm run test:php -- --filter Tests_Dependencies
  2. npm run test:php -- --filter Tests_Dependencies -c tests/phpunit/multisite.xml
  3. npm run test:php -- --filter Tests_Dependencies --order-by=random
  4. npm 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 @lancewillett
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>

#111 @lancewillett
3 weeks ago

In 64741:

Tests: Make block data providers static.

Declare 11 data providers in the block, block template and block supports tests as public static for compatibility with newer PHPUnit versions. Preserve their datasets and assertions.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/14717, ​https://github.com/WordPress/wordpress-develop/pull/14718, ​https://github.com/WordPress/wordpress-develop/pull/14719, ​https://github.com/WordPress/wordpress-develop/pull/14764, ​https://github.com/WordPress/wordpress-develop/pull/14765, ​https://github.com/WordPress/wordpress-develop/pull/14766

Props devmuhib, mukesh27.
See #66211.

#115 @lancewillett
3 weeks ago

In 64742:

Tests: Make user and multisite data providers static.

Declare 41 data providers in the user and multisite tests as public static for compatibility with newer PHPUnit versions. Preserve their datasets and assertions.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/14725, ​https://github.com/WordPress/wordpress-develop/pull/14726, ​https://github.com/WordPress/wordpress-develop/pull/14763, ​https://github.com/WordPress/wordpress-develop/pull/14771

Props devmuhib, therssoftware, mukesh27.
See #66211.

#118 @lancewillett
3 weeks ago

In 64743:

Tests: Make post, comment and term data providers static.

Declare eight data providers in the post, comment, category, taxonomy and term tests as public static for compatibility with newer PHPUnit versions. Preserve their datasets and assertions.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/14622, ​https://github.com/WordPress/wordpress-develop/pull/14623, ​https://github.com/WordPress/wordpress-develop/pull/14624, ​https://github.com/WordPress/wordpress-develop/pull/14788, ​https://github.com/WordPress/wordpress-develop/pull/14791, ​https://github.com/WordPress/wordpress-develop/pull/14801, ​https://github.com/WordPress/wordpress-develop/pull/14805

Props shailu25, mukesh27.
See #66211.

#126 @lancewillett
3 weeks ago

In 64744:

Tests: Make URL, routing, hook and shortcode data providers static.

Declare 20 data providers in the actions, admin bar, canonical, filters, rewrite, shortcode and URL tests as public static for compatibility with newer PHPUnit versions. Preserve their datasets and assertions.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/14706, ​https://github.com/WordPress/wordpress-develop/pull/14723, ​https://github.com/WordPress/wordpress-develop/pull/14724, ​https://github.com/WordPress/wordpress-develop/pull/14790, ​https://github.com/WordPress/wordpress-develop/pull/14792, ​https://github.com/WordPress/wordpress-develop/pull/14793, ​https://github.com/WordPress/wordpress-develop/pull/14803

Props devmuhib, shailu25, mukesh27, huzaifaalmesbah.
See #66211.

#131 @lancewillett
3 weeks ago

In 64745:

Tests: Make file and filesystem data providers static.

Declare 30 data providers in the file, filesystem and file type tests as public static for compatibility with newer PHPUnit versions. Preserve their datasets and assertions.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/14613, ​https://github.com/WordPress/wordpress-develop/pull/14807, ​https://github.com/WordPress/wordpress-develop/pull/14887

Props devmuhib, shailu25, benitoalba, mukesh27, huzaifaalmesbah.
See #66211.

#134 @lancewillett
3 weeks ago

In 64746:

Tests: Make remaining utility data providers static.

Declare 20 data providers in the secrets, cache, database, script dependency and locale tests as public static for compatibility with newer PHPUnit versions. Preserve their datasets and assertions.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/14670, ​https://github.com/WordPress/wordpress-develop/pull/14799, ​https://github.com/WordPress/wordpress-develop/pull/14800, ​https://github.com/WordPress/wordpress-develop/pull/14802, ​https://github.com/WordPress/wordpress-develop/pull/14804, ​https://github.com/WordPress/wordpress-develop/pull/14806

Props ravipatel, shailu25, mukesh27.
See #66211.

#141 @lancewillett
3 weeks ago

In 64747:

Tests: Resolve gallery attachment IDs after fixture setup.

Resolve the gallery shortcode's attachment ID during test execution instead of in the data provider, which runs before fixture setup. Add an unrelated attachment and assert that the response includes only the intended caption.

Preserve the existing success and rejection expectations for all three shortcode cases.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/14832

Props benitoalba.
See #66211.

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_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

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() in Tests_Image_Meta, updating declaration to public 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() and data_contents() in Tests_Privacy_wpPrivacyGeneratePersonalDataExportFile, updating declarations to public 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 to public static, updating $this->text_array_to_dataprovider call to static self::, 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 to public 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_User to public 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 to public 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 to public 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.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

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.php
  • tests/phpunit/tests/image/editorGd.php
  • tests/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 to public 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:

  1. npm run test:php -- tests/phpunit/tests/xmlrpc/demo/addTwoNumbers.php tests/phpunit/tests/xmlrpc/wp/newComment.php tests/phpunit/tests/xmlrpc/wp/uploadFile.php
  2. npm 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.php
  3. npm 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:

  1. tests/phpunit/tests/style-engine/styleEngine.php:
    • data_wp_style_engine_get_styles() -> public static function
  2. tests/phpunit/tests/style-engine/wpStyleEngineCssDeclarations.php:
    • data_should_compile_css_declarations_to_css_declarations_string() -> public static function

Testing Instructions

  1. Run vendor/bin/phpunit --filter Tests_wpStyleEngine -> PASS (42 tests, 42 assertions).
  2. Run vendor/bin/phpunit tests/phpunit/tests/style-engine/wpStyleEngineCssDeclarations.php -> PASS (16 tests, 22 assertions).
  3. 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 to public 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 function
  • data_provider_fetchpriority_values() -> public static function
  • data_provider_to_test_fetchpriority_bumping() -> public static function

Testing Instructions

  1. Run vendor/bin/phpunit --filter test_comprehensive_methods tests/phpunit/tests/script-modules/wpScriptModules.php -> PASS (4 tests, 300 assertions).
  2. Run vendor/bin/phpunit --filter fetchpriority tests/phpunit/tests/script-modules/wpScriptModules.php -> PASS (12 tests, 79 assertions).
  3. 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 to public 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 function
  • data_invalid_request_timeouts() -> public static function

Testing Instructions

  1. Run vendor/bin/phpunit --filter Tests_AI_Client_PromptBuilder -> PASS (194 tests, 499 assertions).
  2. 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 to public 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 function
  • data_get_icon() -> public static function
  • data_get_description() -> public static function
  • data_get_image() -> public static function

Testing Instructions

  1. Run vendor/bin/phpunit tests/phpunit/tests/rest-api/wpRestUrlDetailsController/parsing.php -> PASS (80 tests, 80 assertions).
  2. 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 to public 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:

  1. tests/phpunit/tests/editor/disableBlockEditorForNavigationPostType.php:
    • data_should_return_false_when_wp_navigation()
    • data_should_return_given_value_for_non_wp_navigation_post_types()
  2. tests/phpunit/tests/editor/disableContentEditorForNavigationPostType.php:
    • data_should_not_disable()
    • data_should_not_change_post_type_support()
  3. 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:

  1. tests/phpunit/tests/icons/wpIconCollectionsRegistry.php:
    • data_valid_collection_slugs()
    • data_invalid_collection_slugs()
    • data_boolean_public_properties()
    • data_non_boolean_public_properties()
  2. 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()
  3. tests/phpunit/tests/icons/wpRestIconCollectionsController.php:
    • data_non_public_collections()
  4. 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?

#171 @lancewillett
3 weeks ago

In 64991:

Tests: Make auth, user, comment, and icon data providers static.

Declare 33 data providers as public static for compatibility with newer PHPUnit versions. Preserve their datasets and assertions.

Make the three user-notification callback helpers static and reference them with self::class so the provider does not require a test instance.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/14966, ​https://github.com/WordPress/wordpress-develop/pull/14968, ​https://github.com/WordPress/wordpress-develop/pull/14969, ​https://github.com/WordPress/wordpress-develop/pull/15118

Props rejaulalomkhan, shailu25, mukesh27.
See #66211.

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:

  1. tests/phpunit/tests/connectors/wpConnectorRegistry.php:
    • data_application_password_external_name_keys()
  2. tests/phpunit/tests/connectors/wpConnectorsMaskApiKey.php:
    • data_mask_api_key()
  3. 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:

  1. tests/phpunit/tests/interactivity-api/wpInteractivityAPI-wp-bind.php:
    • data_non_finite_values()
    • data_json_serializable_values() (and declared helper get_json_serializable() as private static)
    • data_non_scalar_values()
  2. 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:

  1. tests/phpunit/tests/entity-fields/wpPreloadEntityFields.php:
    • data_site_editor_screens()
    • data_non_array_paths()
  2. 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:

  1. 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()
  2. 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:

  1. tests/phpunit/tests/media/wpCrossOriginIsolation.php:
    • data_cross_origin_elements()
  2. 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:

  1. tests/phpunit/tests/interactivity-api/wpInteractivityAPI-wp-bind.php:
    • data_non_finite_values()
    • data_json_serializable_values() (along with making helper get_json_serializable() static)
    • data_non_scalar_values()
  2. 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:

  1. tests/phpunit/tests/l10n/wpTextdomainRegistry.php:
    • data_text_domains_sharing_a_prefix()
    • data_domains_locales()
  2. 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

  1. Run PHPCS: vendor/bin/phpcs tests/phpunit/tests/feed/rss2.php tests/phpunit/tests/feed/rssEnclosure.php tests/phpunit/tests/feed/wpSimplePieFile.php
  2. 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

  1. Run PHPCS: vendor/bin/phpcs tests/phpunit/tests/oembed/wpFilterOembedIframeTitleAttributes.php tests/phpunit/tests/oembed/wpFilterOembedResult.php
  2. 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:

  1. tests/phpunit/tests/feed/rss2.php:
    • data_get_feed_build_date()
  2. tests/phpunit/tests/feed/rssEnclosure.php:
    • data_rss_enclosure_with_multiline_enclosure_string()
    • data_rss_enclosure_with_non_valid_enclosure_string()
  3. 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

  1. Run PHPCS: vendor/bin/phpcs tests/phpunit/tests/theme/registerThemeFeature.php tests/phpunit/tests/theme/wpThemeJson.php
  2. 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:

  1. tests/phpunit/tests/oembed/wpFilterOembedIframeTitleAttributes.php:
    • data_oembed_iframe_title_attribute()
  2. 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:

  1. tests/phpunit/tests/theme/registerThemeFeature.php:
    • data_register_theme_support_validation()
  2. 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:

  1. tests/phpunit/tests/html-api/wpHtmlProcessor-serialize.php:
    • data_bogus_comments()
    • data_processing_instructions()
  2. tests/phpunit/tests/html-api/wpHtmlProcessor.php:
    • data_html_processor_with_extended_next_token()
  3. 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:

  1. tests/phpunit/tests/fonts/font-face/wp-font-face-tests-dataset.php:
    • data_should_print_given_fonts() in trait WP_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:

  1. 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:

  1. 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:

  1. 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:

  1. 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()
  2. 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()
  3. tests/phpunit/tests/blocks/render.php:
    • data_do_block_test_filenames()
  4. tests/phpunit/tests/blocks/supportedStyles.php:
    • data_get_block_wrapper_attributes_merge_or_override()
  5. tests/phpunit/tests/blocks/wpBlock.php:
    • data_provider_test_render_enqueues_scripts_and_styles()
    • data_block_has_support_string()
  6. tests/phpunit/tests/blocks/wpBlockParser.php:
    • data_parsing_test_filenames()
  7. 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

Closing in favor of consolidated directory PR #15180 which updates all data providers across tests/phpunit/tests/blocks/ per Trac #66211 comment 109.

#204 @lancewillett
2 weeks ago

In 65006:

Tests: Make widget, block and editor data providers static.

Declare 25 data providers in the widget, block registration, editor, connector, and Interactivity API tests as public static for compatibility with newer PHPUnit versions. Preserve their datasets and assertions.

Make the Interactivity API JSON serialization helper static so providers can call it without a test instance.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/14651, ​https://github.com/WordPress/wordpress-develop/pull/14652, ​https://github.com/WordPress/wordpress-develop/pull/15117, ​https://github.com/WordPress/wordpress-develop/pull/15135, ​https://github.com/WordPress/wordpress-develop/pull/15154

Props devmuhib, rejaulalomkhan, shailu25, huzaifaalmesbah, mukesh27.
See #66211.

#208 @lancewillett
2 weeks ago

In 65007:

Tests: Make entity, menu, media and feed data providers static.

Declare 18 data providers in the entity fields, menu, media, feed, oEmbed, and theme tests as public static for compatibility with newer PHPUnit versions. Preserve their datasets and assertions.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/15155, ​https://github.com/WordPress/wordpress-develop/pull/15157, ​https://github.com/WordPress/wordpress-develop/pull/15159, ​https://github.com/WordPress/wordpress-develop/pull/15167, ​https://github.com/WordPress/wordpress-develop/pull/15168, ​https://github.com/WordPress/wordpress-develop/pull/15170

Props devmuhib, rejaulalomkhan, shailu25, huzaifaalmesbah.
See #66211.

​@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().

#218 @lancewillett
2 weeks ago

In 65027:

Tests: Make style, script module and load data providers static.

Declare ten data providers in the style-engine, script-module, and load tests as public static for compatibility with newer PHPUnit versions. Add explicit array return types to the five load providers. Preserve all datasets and assertions.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/15098, ​https://github.com/WordPress/wordpress-develop/pull/15102, ​https://github.com/WordPress/wordpress-develop/pull/15153

Props rejaulalomkhan, therssoftware, mukesh27.
See #66211.

#222 @lancewillett
2 weeks ago

In 65028:

Tests: Make image, privacy and KSES data providers static.

Declare 25 data providers in the image metadata, privacy export, and KSES tests as public static for compatibility with newer PHPUnit versions. Call the existing static text_array_to_dataprovider() helper with self::. Preserve all datasets and assertions.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/14956, ​https://github.com/WordPress/wordpress-develop/pull/14959, ​https://github.com/WordPress/wordpress-develop/pull/14963

Props rejaulalomkhan, huzaifaalmesbah, mukesh27.
See #66211.

#226 @lancewillett
2 weeks ago

In 65029:

Tests: Make dependency, term binding and XML-RPC providers static.

Declare 52 data providers in the dependency, term-data block binding, and XML-RPC tests as public static for compatibility with newer PHPUnit versions.

Make three script helpers static and call them with self:: from provider callbacks, preserving execution after test setup. Add the array return type to the comment-permissions provider. Preserve all datasets and assertions.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/14908, ​https://github.com/WordPress/wordpress-develop/pull/14971, ​https://github.com/WordPress/wordpress-develop/pull/14972

Props huzaifaalmesbah, rejaulalomkhan, therssoftware, mukesh27, shailu25.
See #66211.

#230 @lancewillett
2 weeks ago

In 65030:

Tests: Make post, query and general data providers static.

Declare 71 data providers as public static for compatibility with newer PHPUnit versions.

Make the post instance helper and two feed-link callbacks static, and update their callers. Preserve deferred fixture access, datasets and assertions.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/14904, ​https://github.com/WordPress/wordpress-develop/pull/14905, ​https://github.com/WordPress/wordpress-develop/pull/14906

Props huzaifaalmesbah, mukesh27.
See #66211.

#234 @lancewillett
2 weeks ago

In 65031:

Tests: Make REST, block-support and localization providers static.

Declare 125 data providers as public static for compatibility with newer PHPUnit versions.

Use self:: for the two REST metadata providers that call another provider. Preserve existing datasets, assertions and fixture behavior.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/14907, ​https://github.com/WordPress/wordpress-develop/pull/15156, ​https://github.com/WordPress/wordpress-develop/pull/15166

Props huzaifaalmesbah, devmuhib, rejaulalomkhan, mukesh27, shailu25.
See #66211.

#238 @lancewillett
2 weeks ago

In 65032:

Tests: Make HTML API and font data providers static.

Declare four HTML API data providers and the shared font-face data provider as public static for compatibility with newer PHPUnit versions.

Preserve existing datasets, assertions and fixture behavior.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/15173, ​https://github.com/WordPress/wordpress-develop/pull/15175

Props rejaulalomkhan.
See #66211.

#241 @lancewillett
2 weeks ago

In 65033:

Tests: Make Customizer and text-diff data providers static.

Declare the widget control and text-diff compatibility data providers as public static for compatibility with newer PHPUnit versions.

Preserve existing datasets and assertions.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/15177, ​https://github.com/WordPress/wordpress-develop/pull/15178

Props rejaulalomkhan.
See #66211.

#244 @lancewillett
2 weeks ago

In 65034:

Tests: Make AI client timeout data providers static.

Declare the valid and invalid request-timeout data providers as public static for compatibility with newer PHPUnit versions.

Preserve existing datasets and assertions.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/15103

Props rejaulalomkhan, mukesh27.
See #66211.

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

  1. npm run test:php -- --filter Tests_TestHelpers
  2. npm run test:php -- --filter TestFactoryFor
  3. npm run test:php -- --filter Tests_Includes_UploadSnapshot
  4. npm run test:php -- --filter Tests_TestHelpers -c tests/phpunit/multisite.xml
  5. vendor/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

  1. npm run test:php -- --filter Tests_Abilities_API_WpRegisterCoreContentAbility
  2. npm run test:php -- --filter Tests_Abilities_API_WpRegisterCoreContentAbility -c tests/phpunit/multisite.xml
  3. npm run test:php -- --filter Tests_Abilities_API_WpRegisterCoreContentAbility --order-by=random
  4. vendor/bin/phpcs tests/phpunit/tests/abilities-api/wpRegisterCoreContentAbility.php

Use of AI Tools

  • Cursor

#248 @huzaifaalmesbah
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 the public static signature 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 drop register.php, already committed in r65006)
  • tests/phpunit/tests/pluggable/ (3) — ​PR 15176 (covers 2 so far; needs signatures.php added and its direct provider call changed to self::)
  • tests/phpunit/tests/block-bindings/patternOverridesSource.php (2) — ​PR 14970 (needs rebase after r64987, which removed data_empty_context())

Available Subdirectories (Ready for PRs — 58 providers):

  • tests/phpunit/tests/link/ (8 providers across 6 files) — No $this
  • tests/phpunit/tests/wp/ (4 providers across 2 files) — No $this
  • tests/phpunit/tests/privacy/ (3 providers in wpPrivacyProcessPersonalDataExportPage.php) — No $this
  • tests/phpunit/tests/block-bindings/render.php (3 providers) — No $this
  • tests/phpunit/tests/kses/ (3 providers across 2 files) — No $this
  • tests/phpunit/tests/sitemaps/ (2 providers in wpSitemapsPosts.php and wpSitemapsTaxonomies.php, added in r65043) — No $this
  • tests/phpunit/tests/pomo/pluralForms.php (1 provider) — No $this
  • tests/phpunit/tests/admin/wpAutomaticUpdater.php (1 provider) — No $this
  • tests/phpunit/tests/user/ (12 providers across 5 files; 3 in capabilities.php use $this)
  • tests/phpunit/tests/image/ (14 providers across 4 files; 7 in functions.php use $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 $this
  • tests/rest-api.php (13 providers) — No $this
  • tests/post.php (5 providers) — No $this
  • tests/block-template.php (3 providers) — No $this
  • tests/build-visual-html-tree.php (3 providers) — No $this
  • tests/view-config.php (2 providers) — No $this
  • tests/meta.php (1 provider) — No $this
  • tests/vars.php (1 provider) — No $this
  • tests/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:

  1. tests/phpunit/tests/link/editTermLink.php:
    • data_edit_term_link()
  2. tests/phpunit/tests/link/getEditTermLink.php:
    • data_get_edit_term_link()
  3. tests/phpunit/tests/link/getFeedLink.php:
    • data_plain_permastruct()
    • data_pretty_permastruct()
  4. tests/phpunit/tests/link/getPagenumLink.php:
    • data_get_pagenum_link_plain_permalinks()
    • data_get_pagenum_link()
  5. tests/phpunit/tests/link/getThePostsNavigation.php:
    • data_get_the_posts_navigation()
  6. 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:

  1. tests/phpunit/tests/wp/handle404.php:
    • data_sitemap_requests()
  2. 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:

  1. tests/phpunit/tests/sitemaps/wpSitemapsPosts.php:
    • data_sitemap_does_not_404_for_valid_sitemap_subtypes()
  2. 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:

  1. tests/phpunit/tests/kses/wpFilterGlobalStylesPost.php:
    • data_should_not_remove_safe_global_style_rules()
  2. 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_defs property to protected static and accessed it via self::$table_and_column_defs.
  • Used self::assertNotSame() and self::assertSame() inside data_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:

  1. tests/phpunit/tests/user/wpListUsers.php:
    • data_should_create_a_user_list()
    • data_should_not_create_a_user_list()
  2. tests/phpunit/tests/user/queryCache.php:
    • data_query_cache()
  3. tests/phpunit/tests/user/newUserEmailAdminNotice.php:
    • data_multisite_admin_notice_actions()
  4. tests/phpunit/tests/user/mapMetaCap.php:
    • data_meta_caps_throw_doing_it_wrong_without_required_argument_provided()
  5. 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/ to public static:
    • tests/phpunit/tests/image/functions.php:
      • get_image_editor_engine_classes() helper converted to private static.
      • data_image_editor_engine_classes() converted to public static using self::text_array_to_dataprovider().
      • data_file_is_valid_image_positive() converted to public static.
      • data_file_is_valid_image_negative() converted to public static.
      • data_file_is_displayable_image_positive() converted to public static.
      • data_file_is_displayable_image_negative() converted to public static.
      • data_wp_save_image_file() converted to public static.
      • data_wp_image_editor_should_respect_image_edit_thumbnails_separately_filters() converted to public static.
      • data_inferred_mime_types_when_saving_an_image() converted to public static.
      • data_wp_exif_frac2dec() converted to public static.
    • tests/phpunit/tests/image/size.php:
      • data_constrain_size_for_editor_invalid_size() converted to public static.
    • tests/phpunit/tests/image/editor.php:
      • data_wp_get_webp_info() converted to public static.
      • data_wp_get_avif_info() converted to public static.
    • tests/phpunit/tests/image/editorGd.php:
      • data_crop() converted to public static.
      • data_crop_invalid_dimensions() converted to public static.

Testing Instructions

  1. Run PHPCS across the modified files:
    vendor/bin/phpcs tests/phpunit/tests/image/
    
  1. 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_"
    
  1. 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() to public static, along with its helper methods getAllCapsAndRoles(), getMetaCapsAndRoles(), _getSingleSiteMetaCaps(), and _getMultiSiteMetaCaps().
  • Converted dataTaxonomies() to public static.
  • All tests pass cleanly on both single-site (765 tests, 2949 assertions) and multisite (775 tests, 3183 assertions).

#263 @lancewillett
2 weeks ago

In 65067:

Tests: Make factory, abilities and link data providers static.

Declare 44 existing data providers as public static for compatibility with newer PHPUnit versions. Preserve their datasets and assertions.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/15201, ​https://github.com/WordPress/wordpress-develop/pull/15202, ​https://github.com/WordPress/wordpress-develop/pull/15213

Props shailu25, devmuhib, huzaifaalmesbah.
See #66211.

#267 @lancewillett
2 weeks ago

In 65068:

Tests: Make request, sitemap and KSES data providers static.

Declare nine existing data providers as public static for compatibility with newer PHPUnit versions. Preserve their datasets and assertions.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/15214, ​https://github.com/WordPress/wordpress-develop/pull/15215, ​https://github.com/WordPress/wordpress-develop/pull/15216

Props devmuhib, shailu25, huzaifaalmesbah.
See #66211.

#271 @lancewillett
2 weeks ago

In 65069:

Tests: Make privacy, plural-form and updater data providers static.

Declare five existing data providers as public static for compatibility with newer PHPUnit versions. Preserve their datasets and assertions.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/15217, ​https://github.com/WordPress/wordpress-develop/pull/15229, ​https://github.com/WordPress/wordpress-develop/pull/15230

Props devmuhib, shailu25, huzaifaalmesbah.
See #66211.

#275 @lancewillett
2 weeks ago

In 65070:

Tests: Make block and HTML-tree data providers static.

Declare nine existing data providers in the block-binding, HTML-tree comparison and block-template tests as public static. Preserve their datasets and assertions for compatibility with newer PHPUnit versions.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/15231, ​https://github.com/WordPress/wordpress-develop/pull/15232, ​https://github.com/WordPress/wordpress-develop/pull/15233

Props devmuhib, huzaifaalmesbah.
See #66211.

#279 @lancewillett
2 weeks ago

In 65071:

Tests: Make database charset data providers static.

Declare seven existing data providers as public static. Make the read-only table definitions static and update property access and assertion calls, preserving datasets and assertions.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/15234

Props devmuhib, huzaifaalmesbah.
See #66211.

#280 @lancewillett
2 weeks ago

In 65073:

Tests: Make user data providers and capability helpers static.

Declare twelve existing user-test data providers as public static. Convert their capability-map helpers and update helper calls without changing datasets or assertions.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/15235

Props devmuhib, huzaifaalmesbah.
See #66211.

#281 @lancewillett
2 weeks ago

In 65074:

Tests: Make image data providers and editor discovery static.

Declare fourteen existing image-test data providers as public static. Make the editor-discovery helper static and update helper calls, preserving datasets and assertions.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/15236

Props devmuhib, huzaifaalmesbah.
See #66211.

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

  1. npm run test:php -- --filter Tests_Post
  2. npm run test:php -- --filter Tests_View_Config
  3. npm run test:php -- --filter Tests_DB
  4. npm 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.

#290 @lancewillett
2 weeks ago

In 65127:

Tests: Make REST API data providers static.

Declare the remaining 13 data providers in tests/phpunit/tests/rest-api.php as public static for PHPUnit compatibility. Preserve existing datasets and assertions.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/15299

Props rejaulalomkhan, huzaifaalmesbah.
See #66211.

#291 @lancewillett
2 weeks ago

In 65128:

Tests: Make block and pluggable data providers static.

Convert the remaining providers and fixture callbacks to static methods. Preserve datasets, expectations, and the already-landed provider cleanup.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/14970, ​https://github.com/WordPress/wordpress-develop/pull/15176, ​https://github.com/WordPress/wordpress-develop/pull/15180

Props rejaulalomkhan, shailu25, mukesh27.
See #66211.

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() in tests/phpunit/tests/bookmark-template/walkBookmarks.php
  • Tests_wp_list_bookmarks::data_wp_list_bookmarks_categorized() in tests/phpunit/tests/bookmark-template/wpListBookmarks.php
  • Tests_wp_list_bookmarks::data_wp_list_bookmarks_uncategorized() in tests/phpunit/tests/bookmark-template/wpListBookmarks.php

All data providers are pure data sets and do not rely on instance state.

Testing Instructions

  1. Run single site tests: php ./vendor/bin/phpunit --filter Tests_walk_bookmarks php ./vendor/bin/phpunit --filter Tests_wp_list_bookmarks
  2. Run multisite tests: php ./vendor/bin/phpunit -c tests/phpunit/multisite.xml --filter Tests_walk_bookmarks php ./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() in tests/phpunit/tests/admin/includes/misc/gotModRewrite.php
  • Tests_iis7_add_rewrite_rule::data_iis7_add_rewrite_rule() in tests/phpunit/tests/admin/includes/misc/iis7AddRewriteRule.php
  • Tests_iis7_rewrite_rule_exists::data_iis7_rewrite_rule_exists() in tests/phpunit/tests/admin/includes/misc/iis7RewriteRuleExists.php
  • Tests_wp_make_plugin_file_tree::data_wp_make_plugin_file_tree() in tests/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() in tests/phpunit/tests/functions/_wpCheckExistingFileNames.php
  • Tests_Media_GetMediaEmbeddedInContent::data_content() in tests/phpunit/tests/media/getMediaEmbeddedInContent.php
  • Tests_Meta::data_get_metadata_with_non_existent_object_id() in tests/phpunit/tests/meta.php
  • Tests_Vars::get_data_to_test_wp_is_mobile() in tests/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() and get_insufficient_width_height_for_high_priority() private static and called them via self::.

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.

#300 @lancewillett
2 weeks ago

In 65162:

Tests: Make more data providers public and static.

Update post, database, view configuration, bookmark, admin, media, metadata, and variable test providers for newer PHPUnit versions. Use static calls for the media dimension helpers without changing datasets or assertions.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/15270, ​https://github.com/WordPress/wordpress-develop/pull/15308, ​https://github.com/WordPress/wordpress-develop/pull/15309, ​https://github.com/WordPress/wordpress-develop/pull/15310, ​https://github.com/WordPress/wordpress-develop/pull/15311

Props shailu25, rejaulalomkhan, devmuhib, huzaifaalmesbah.
See #66211.

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

  1. Run single site tests: npm run test:php -- --filter Tests_Template::test_wp_hoist_late_printed_styles
  2. 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

  1. Run single site tests: npm run test:php -- --filter Tests_Theme::test_year_in_readme npm run test:php -- --filter Tests_Theme::test_version_consistency_in_package_json npm run test:php -- --filter Tests_Theme::test_default_themes_are_included_in_new_files
  2. 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

  1. Run single site tests: npm run test:php -- --filter Tests_View_Config_API::test_excerpt_layout_shows_placeholder_if_empty npm run test:php -- --filter Tests_View_Config_API::test_author_layout_shows_placeholder_if_empty
  2. 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

  1. Run single site tests: npm run test:php -- --filter Tests_wp_ajax_time_format
  2. 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

  1. Run single site tests: npm run test:php -- --filter Tests_PHPUnit_GroupFilters
  2. Run multisite tests: npm run test:php -- --filter Tests_PHPUnit_GroupFilters -c tests/phpunit/multisite.xml

#316 @lancewillett
9 days ago

In 65313:

Tests: Make template, theme and other data providers public and static.

Update the template, theme, view configuration, Ajax time format and PHPUnit group filter test providers for newer PHPUnit versions. Two providers used $this: the late-printed styles provider now uses static closures with self::assert*(), and the default themes list is now a static property.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/15730, ​https://github.com/WordPress/wordpress-develop/pull/15731, ​https://github.com/WordPress/wordpress-develop/pull/15732, ​https://github.com/WordPress/wordpress-develop/pull/15733, ​https://github.com/WordPress/wordpress-develop/pull/15734, ​https://github.com/WordPress/wordpress-develop/pull/15442, ​https://github.com/WordPress/wordpress-develop/pull/15438

Props fozlerabbi48, devmuhib.
See #66211.

#324 @huzaifaalmesbah
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_updates and data_translation_update_selections in tests/phpunit/tests/admin/includesUpdate.php.
  • ​PR 15440 covers data_bulk_upgrade_results in tests/phpunit/tests/admin/languagePackUpgrader.php.
  • ​PR 15441 covers data_invalid_arguments in tests/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.

Note: See TracTickets for help on using tickets.