Repository navigation
Conversation
…tatic Declare the data providers in `tests/phpunit/tests/media/` as `public static` for compatibility with newer PHPUnit versions. Preserve their datasets and assertions. See #66211.
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the 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. |
There was a problem hiding this comment.
🟢 Approval recommended
The converted providers are independent of instance state, and no datasets or assertions change.
No open issues 🎉
What changed in this PR
Updates WordPress media test data providers for compatibility with newer PHPUnit versions.
Changes:
- Declares ten data providers
public staticacross nine files. - Preserves existing datasets and assertions.
| File | Description |
|---|---|
| tests/phpunit/tests/media/wpImageTagAddDecodingAttr.php | Makes both decoding-attribute providers static. |
| tests/phpunit/tests/media/wpGetChromiumMajorVersion.php | Makes the user-agent provider static. |
| tests/phpunit/tests/media/wpCrossOriginIsolation.php | Makes the site-editor route provider static. |
| tests/phpunit/tests/media/previousImageLink.php | Makes the previous-link provider static. |
| tests/phpunit/tests/media/nextImageLink.php | Makes the next-link provider static. |
| tests/phpunit/tests/media/getPreviousImageLink.php | Makes the previous-link retrieval provider static. |
| tests/phpunit/tests/media/getPostGalleries.php | Makes the gallery-content provider static. |
| tests/phpunit/tests/media/getNextImageLink.php | Makes the next-link retrieval provider static. |
| tests/phpunit/tests/media/getAdjacentImageLink.php | Makes the adjacent-link provider static. |
Review effort: Balanced
lancewillett
left a comment
There was a problem hiding this comment.
The unit-tests audit confirms all ten providers are safe to call statically, with datasets and assertions unchanged. Randomized single-site and multisite runs each passed 84 tests and 162 assertions, without skips. All nine classes also passed independently; PHPCS and CI are green. Copilot’s fresh review found no issues.
AI review · gpt-6
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: #14462 Props therssoftware. See #66211. git-svn-id: https://develop.svn.wordpress.org/trunk@64580 602fd350-edb4-49c9-b593-d223f7449a82
|
PR #14462 landed in https://core.trac.wordpress.org/changeset/64580 |
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: WordPress/wordpress-develop#14462 Props therssoftware. See #66211. Built from https://develop.svn.wordpress.org/trunk@64580 git-svn-id: http://core.svn.wordpress.org/trunk@63730 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Trac ticket: https://core.trac.wordpress.org/ticket/66211
Summary
Declare the data providers in
tests/phpunit/tests/media/aspublic staticfor compatibility with newer PHPUnit versions. Preserve their datasets and assertions.Testing Instructions
Run:
vendor/bin/phpunit --group mediavendor/bin/phpcs tests/phpunit/tests/media/All tests pass cleanly.
Props @therssoftware.