Repository navigation
Tests: Make data providers in tests/phpunit/tests/blocks/register.php public and static - #14954
rejaulalomkhan wants to merge 1 commit into
Conversation
… public and static Data providers should be declared public static to align with modern PHPUnit best practices and requirements. See #66211.
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
|
|
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
Would you like to add these files to this PR to complete the |
|
Closing in favor of consolidated directory PR #15180 which updates all data providers across tests/phpunit/tests/blocks/ per Trac #66211 comment 109. |
Description
In
tests/phpunit/tests/blocks/register.php, several data provider methods were declared as non-static.Declaring data providers as
public staticaligns with modern PHPUnit best practices and requirements for PHPUnit 10+.This PR updates the following data provider methods to
public static:data_register_block_style_handle_uses_correct_core_stylesheetdata_register_block_registers_with_args_override_returns_false_when_name_is_missingdata_register_block_type_accepts_editor_script_arraydata_register_block_type_throws_doing_it_wrongdata_register_block_style_name_contains_spacesTesting Instructions
Run the block registration unit tests:
Run PHPCS verification:
Trac ticket: https://core.trac.wordpress.org/ticket/66211
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
$thisstate; static method conversion and local PHPCS/PHPUnit verification were reviewed and validated by me.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.