Skip to content

WordPress 7.2 single use data provider names. - #15960

Draft
peterwilsoncc wants to merge 73 commits into
WordPress:trunkfrom
peterwilsoncc:72-data-provider-names
Draft

peterwilsoncc wants to merge 73 commits into
WordPress:trunkfrom
peterwilsoncc:72-data-provider-names

Conversation

@peterwilsoncc

@peterwilsoncc peterwilsoncc commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Renames and moves single-use data providers added during the 7.2 release cycle to follow the PHPUnit tests handbook recommendations: a data provider used by a single test is named after that test, with test_ replaced by data_, and sits immediately below the test.

The 7.2 cycle is taken as everything after r63163 (7f8a28c), the last commit to trunk before the 7.1 branch was created, up to and including r65441 (6872cd4). A full list of the affected tests, grouped by the commit that introduced them, is at WP 7.2 Data Provider Notes.

Changes

  • 395 data providers in 204 test files:
    • 333 renamed;
    • 24 moved below their test;
    • 38 renamed and moved.
  • Only test files change, and only by renaming a provider (its declaration and its @dataProvider annotation) or moving it, with its docblock, to directly below its test. No test logic or data changes.
  • The pull request has 73 commits, one per ticket. Each commit lists the commits it follows up and the tickets those commits referenced.

What's included

  • Single use: a provider counts as single use if exactly one @dataProvider annotation or DataProvider attribute in the test suite references it.
  • Only problems from this cycle: providers that already broke these recommendations before the 7.2 cycle began are left alone, so providers that were only touched during the cycle (for example, made static) are not changed.
  • Two left as they are: data_published_error_codes in tests/secrets/errorCodes.php and data_input_is_coerced in tests/abilities-api/wpAbility.php. Each is used by a single @dataProvider, but other tests also call it directly, so it is shared data and keeps its descriptive name.

Testing

  • Each changed test file was run on its own on trunk and on this branch, with the multisite configuration where the file has multisite tests and with --group ajax where it has AJAX tests. The test and assertion counts match for every file.
  • PHPCS reports no errors or warnings for the changed files, and php -l passes for all of them.
  • Re-running the scan on this branch finds no remaining single-use data providers from the 7.2 cycle that break the recommendations.

Trac ticket:

Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5
Used for: Finding the affected tests, writing the scripts that made the renames and moves, running the tests and writing this description.


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.

@peterwilsoncc peterwilsoncc changed the title 72 data provider names WordPress 7.2 data provider names Nov 12, 2026
Renames a single-use data provider after the test that uses it, as recommended in the PHPUnit tests handbook.

Follow-up to r63179.

See #65372.
Renames a single-use data provider after the test that uses it, as recommended in the PHPUnit tests handbook.

Follow-up to r63298.

See #65781.
Renames a single-use data provider after the test that uses it, as recommended in the PHPUnit tests handbook.

Follow-up to r63307.

See #65016.
Renames a single-use data provider after the test that uses it, as recommended in the PHPUnit tests handbook.

Follow-up to r63343.

See #65569.
Renames a single-use data provider after the test that uses it, as recommended in the PHPUnit tests handbook.

Follow-up to r63362.

See #62348.
Renames a single-use data provider after the test that uses it, as recommended in the PHPUnit tests handbook.

Follow-up to r63418.

See #65984.
Renames a single-use data provider after the test that uses it, as recommended in the PHPUnit tests handbook.

Follow-up to r63513.

See #65824.
Renames single-use data providers after the test that uses each one and moves any misplaced provider immediately below its test, as recommended in the PHPUnit tests handbook.

Follow-up to r63566.

See #65914.
Renames single-use data providers after the test that uses them, as recommended in the PHPUnit tests handbook.

Follow-up to r63570.

See #65945, #39157, #61293.
Renames a single-use data provider after the test that uses it, as recommended in the PHPUnit tests handbook.

Follow-up to r63579.

See #52320.
Renames a single-use data provider after the test that uses it, as recommended in the PHPUnit tests handbook.

Follow-up to r63631.

See #66074.
Renames a single-use data provider after the test that uses it, as recommended in the PHPUnit tests handbook.

Follow-up to r63886.

See #66151, #65817.
Renames single-use data providers after the test that uses each one and moves any misplaced provider immediately below its test, as recommended in the PHPUnit tests handbook.

Follow-up to r63888, r63913, r64994, r65090, r65405.

See #66138.
Renames a single-use data provider after the test that uses it, as recommended in the PHPUnit tests handbook.

Follow-up to r63902.

See #59446, #59444.
Renames a single-use data provider after the test that uses it, as recommended in the PHPUnit tests handbook.

Follow-up to r63915.

See #61996.
Renames single-use data providers after the test that uses them, as recommended in the PHPUnit tests handbook.

Follow-up to r63925.

See #66111.
Renames a single-use data provider after the test that uses it and moves it immediately below its test, as recommended in the PHPUnit tests handbook.

Follow-up to r63999.

See #66158.
Moves a single-use data provider immediately below the test that uses it, as recommended in the PHPUnit tests handbook.

Follow-up to r64073.

See #65593.
Renames single-use data providers after the test that uses each one and moves any misplaced provider immediately below its test, as recommended in the PHPUnit tests handbook.

Follow-up to r64085, r64086, r64287, r64308, r64324, r64330, r64332, r64357, r64360, r64361, r64368, r64369, r64372, r64373, r64374, r64377, r64378, r64380, r64381, r64382, r64393, r64395, r64396, r64397, r64403, r64411, r64412, r64414, r64415, r64416, r64417, r64420, r64421, r64422, r64424, r64425, r64427, r64429, r64454, r64456, r64461, r64469, r64470, r64472, r64510, r64513, r64514, r64515, r64516, r64532, r64534, r64540, r64547, r64549, r64564, r64565, r64568, r64569, r64570, r64608, r64611, r64612, r64613, r64614, r64626, r64628, r64629, r64633, r64651, r64652, r64659, r64660, r64661, r64662, r64663, r64665, r64666, r64667, r64809, r64977, r65008, r65009, r65011, r65039, r65041, r65048, r65050, r65051, r65056, r65080, r65085, r65111, r65113, r65118, r65129, r65131, r65136, r65138, r65141, r65143, r65172, r65198.

See #65819, #66079, #66078.
Renames single-use data providers after the test that uses each one and moves any misplaced provider immediately below its test, as recommended in the PHPUnit tests handbook.

Follow-up to r64120.

See #57548.
Renames single-use data providers after the test that uses them, as recommended in the PHPUnit tests handbook.

Follow-up to r64224.

See #66114.
Renames a single-use data provider after the test that uses it, as recommended in the PHPUnit tests handbook.

Follow-up to r64233.

See #37698, #58921, #59310, #63208.
Renames single-use data providers after the test that uses them, as recommended in the PHPUnit tests handbook.

Follow-up to r64238.

See #66263.
Renames a single-use data provider after the test that uses it, as recommended in the PHPUnit tests handbook.

Follow-up to r64239.

See #66173.
Renames a single-use data provider after the test that uses it, as recommended in the PHPUnit tests handbook.

Follow-up to r64247.

See #59956, #65817.
Renames a single-use data provider after the test that uses it, as recommended in the PHPUnit tests handbook.

Follow-up to r64284.

See #65893.
Renames single-use data providers after the test that uses them, as recommended in the PHPUnit tests handbook.

Follow-up to r64286.

See #61072.
Renames a single-use data provider after the test that uses it, as recommended in the PHPUnit tests handbook.

Follow-up to r64301.

See #50699, #51419.
Renames a single-use data provider after the test that uses it, as recommended in the PHPUnit tests handbook.

Follow-up to r64310.

See #66287.
Renames single-use data providers after the test that uses them, as recommended in the PHPUnit tests handbook.

Follow-up to r64590.

See #66094.
Moves single-use data providers immediately below the test that uses them, as recommended in the PHPUnit tests handbook.

Follow-up to r64689.

See #66372, #66267.
Renames single-use data providers after the test that uses them, as recommended in the PHPUnit tests handbook.

Follow-up to r64730.

See #46992.
Renames a single-use data provider after the test that uses it, as recommended in the PHPUnit tests handbook.

Follow-up to r64731.

See #66329.
Renames a single-use data provider after the test that uses it, as recommended in the PHPUnit tests handbook.

Follow-up to r65023.

See #65600, #66168.
Renames single-use data providers after the test that uses each one and moves any misplaced provider immediately below its test, as recommended in the PHPUnit tests handbook.

Follow-up to r65044, r65368.

See #66383.
Renames a single-use data provider after the test that uses it, as recommended in the PHPUnit tests handbook.

Follow-up to r65060.

See #28801.
Moves a single-use data provider immediately below the test that uses it, as recommended in the PHPUnit tests handbook.

Follow-up to r65112.

See #53987.
Renames a single-use data provider after the test that uses it, as recommended in the PHPUnit tests handbook.

Follow-up to r65121.

See #65751, #65931.
Renames a single-use data provider after the test that uses it, as recommended in the PHPUnit tests handbook.

Follow-up to r65122.

See #65693, #49799.
Renames a single-use data provider after the test that uses it, as recommended in the PHPUnit tests handbook.

Follow-up to r65126.

See #48300.
Renames single-use data providers after the test that uses them, as recommended in the PHPUnit tests handbook.

Follow-up to r65176.

See #63914.
Renames single-use data providers after the test that uses them, as recommended in the PHPUnit tests handbook.

Follow-up to r65178, r65210, r65267.

See #65252.
Moves a single-use data provider immediately below the test that uses it, as recommended in the PHPUnit tests handbook.

Follow-up to r65181.

See #65183.
Renames a single-use data provider after the test that uses it, as recommended in the PHPUnit tests handbook.

Follow-up to r65222.

See #66447.
Renames single-use data providers after the test that uses them, as recommended in the PHPUnit tests handbook.

Follow-up to r65226.

See #42281.
Renames a single-use data provider after the test that uses it and moves it immediately below its test, as recommended in the PHPUnit tests handbook.

Follow-up to r65228.

See #66452.
Renames a single-use data provider after the test that uses it, as recommended in the PHPUnit tests handbook.

Follow-up to r65251.

See #34185.
Renames a single-use data provider after the test that uses it, as recommended in the PHPUnit tests handbook.

Follow-up to r65271.

See #63990, #63932.
Renames single-use data providers after the test that uses them, as recommended in the PHPUnit tests handbook.

Follow-up to r65273.

See #65981.
Moves a single-use data provider immediately below the test that uses it, as recommended in the PHPUnit tests handbook.

Follow-up to r65290.

See #65228.
Renames a single-use data provider after the test that uses it, as recommended in the PHPUnit tests handbook.

Follow-up to r65307.

See #66493.
Renames a single-use data provider after the test that uses it, as recommended in the PHPUnit tests handbook.

Follow-up to r65319.

See #66419.
Renames a single-use data provider after the test that uses it, as recommended in the PHPUnit tests handbook.

Follow-up to r65332.

See #66359.
Renames single-use data providers after the test that uses each one and moves any misplaced provider immediately below its test, as recommended in the PHPUnit tests handbook.

Follow-up to r65370.

See #66482, #66383.
Renames a single-use data provider after the test that uses it, as recommended in the PHPUnit tests handbook.

Follow-up to r65375.

See #66414, #66187.
Renames single-use data providers after the test that uses them, as recommended in the PHPUnit tests handbook.

Follow-up to r65411.

See #66591.
Renames a single-use data provider after the test that uses it, as recommended in the PHPUnit tests handbook.

Follow-up to r65440.

See #66625, #64498.
@peterwilsoncc peterwilsoncc changed the title WordPress 7.2 data provider names WordPress 7.2 single use data provider names. Nov 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant