Repository navigation
Tests: Make pattern overrides block bindings data providers static - #14970
rejaulalomkhan wants to merge 2 commits into
Conversation
Declare data providers in tests/phpunit/tests/block-bindings/patternOverridesSource.php as public static for compatibility with newer PHPUnit versions. 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:
|
shail-mehta
left a comment
There was a problem hiding this comment.
LGTM👍
Providers don't use instance state, so making them static looks correct.
As per Lance's note on #66211, Please group by directory (or ~6–8 files) for follow-ups instead of one PR per file.
lancewillett
left a comment
There was a problem hiding this comment.
Please refresh this against trunk. r64987 removed data_empty_context() and trimmed the other two providers, so the current patch no longer applies.
Keep that cleanup intact and make only the two surviving providers static: data_empty_metadata_names() and data_override_values_and_types(). Please preserve their current datasets and leave test_get_value_returns_null_when_context_empty() without a provider.
AI review · gpt-6
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the PHPUnit 10+ data-provider compatibility update.
No open issues 🎉
What changed in this PR
Updates the pattern overrides block bindings tests for PHPUnit 10+ compatibility by declaring all three affected data providers public static.
Changes:
- Converts
data_empty_metadata_names(),data_empty_context(), anddata_override_values_and_types()to static methods. - Leaves test datasets and assertions unchanged.
| File | Description |
|---|---|
tests/phpunit/tests/block-bindings/patternOverridesSource.php |
Makes three data providers static to meet PHPUnit 10+ requirements. |
Review effort: Balanced
# Conflicts: # tests/phpunit/tests/block-bindings/patternOverridesSource.php
|
@lancewillett Merged trunk (f86841c). The file now matches trunk apart from |
lancewillett
left a comment
There was a problem hiding this comment.
The refresh preserves the trunk cleanup and datasets; only the two surviving providers change to static.
Static checks passed. The affected classes passed together in randomized single-site and multisite runs: 408 tests and 1,383 assertions in each mode.
AI review · gpt-6
Convert the remaining providers and fixture callbacks to static methods. Preserve datasets, expectations, and the already-landed provider cleanup. Developed in: #14970, #15176, #15180 Props rejaulalomkhan, shailu25, mukesh27. See #66211. git-svn-id: https://develop.svn.wordpress.org/trunk@65128 602fd350-edb4-49c9-b593-d223f7449a82
Convert the remaining providers and fixture callbacks to static methods. Preserve datasets, expectations, and the already-landed provider cleanup. Developed in: WordPress/wordpress-develop#14970, WordPress/wordpress-develop#15176, WordPress/wordpress-develop#15180 Props rejaulalomkhan, shailu25, mukesh27. See #66211. Built from https://develop.svn.wordpress.org/trunk@65128 git-svn-id: http://core.svn.wordpress.org/trunk@64277 1a063a9b-81f0-0310-95a4-ce76da25c4cd
|
PR #14970 landed in https://core.trac.wordpress.org/changeset/65128 |
Description
Makes the two data providers in
tests/phpunit/tests/block-bindings/patternOverridesSource.phppublic static:data_empty_metadata_names()anddata_override_values_and_types(). PHPUnit 10+ requires static data providers, and neither uses instance state.Refreshed against trunk after r64987, which removed
data_empty_context()and trimmed the other two providers. Their current datasets are unchanged, andtest_get_value_returns_null_when_context_empty()stays without a provider.Testing
All pass (13 tests, 16 assertions); PHPCS: no errors.
Trac ticket: https://core.trac.wordpress.org/ticket/66211
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
AI assistance: Yes
Tool(s): Google Antigravity (original change), Claude Code (review follow-up)
Model(s): Gemini 2.5 Pro, Claude Opus 5.5
Used for: Converting the providers, then merging trunk after r64987 and running the tests. I reviewed every line and take responsibility for the change.