Skip to content

Tests: Make data providers in tests/phpunit/tests/media/ public and static - #14462

Closed
robelsust wants to merge 2 commits into
WordPress:trunkfrom
robelsust:test/66211-media-static-data-providers
Closed

robelsust wants to merge 2 commits into
WordPress:trunkfrom
robelsust:test/66211-media-static-data-providers

Conversation

@robelsust

Copy link
Copy Markdown

Trac ticket: https://core.trac.wordpress.org/ticket/66211

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.

…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.
@github-actions

github-actions Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

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 props-bot label.

Core Committers: Use this line as a base for the props when committing in SVN:

Props therssoftware, lancewillett.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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 static across 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 lancewillett left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

wporg-sync pushed a commit that referenced this pull request Oct 19, 2026
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
@lancewillett

Copy link
Copy Markdown
Member

wporg-sync pushed a commit to WordPress/WordPress that referenced this pull request Oct 19, 2026
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
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.

3 participants