Repository navigation
Tests: Make data providers in tests/phpunit/tests/media.php public static - #15311
devmuhib009 wants to merge 1 commit into
Conversation
…atic. See #66211. Props devmuhib009.
|
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:
|
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the media data-provider updates supporting PHPUnit 10+ compatibility.
No open issues 🎉
What changed in this PR
Updates the media test suite’s remaining data providers to prepare for PHPUnit 10+ requirements, supporting the migration tracked in Trac #66211.
Changes:
- Declares 23 data providers as
public static. - Converts two dimension helpers to
private staticand updates their callers to useself::. - Leaves test datasets and assertions unchanged.
| File | Description |
|---|---|
tests/phpunit/tests/media.php |
Makes data providers and supporting helpers static for modern PHPUnit compatibility. |
Review effort: Balanced
huzaifaalmesbah
left a comment
There was a problem hiding this comment.
Thanks! All 23 providers and both helpers are static, with no $this left in them. LGTM.
AI Review: Opus 5.5
lancewillett
left a comment
There was a problem hiding this comment.
Reviewed the changed code against the implementation and existing coverage; no blocking issue found.
Validated with the related provider/factory patches on current trunk: 1,108 tests and 2,503 assertions in each of single-site and multisite, randomized seed 1101. The same two environment-dependent skips occurred before and after; no failures or errors.
Current-head CI and Copilot review checked.
AI review · gpt-6
Update post, database, view configuration, bookmark, admin, media, metadata, and variable test providers for newer PHPUnit versions. Use static calls for the media dimension helpers without changing datasets or assertions. Developed in: #15270, #15308, #15309, #15310, #15311 Props shailu25, rejaulalomkhan, devmuhib, huzaifaalmesbah. See #66211. git-svn-id: https://develop.svn.wordpress.org/trunk@65162 602fd350-edb4-49c9-b593-d223f7449a82
Update post, database, view configuration, bookmark, admin, media, metadata, and variable test providers for newer PHPUnit versions. Use static calls for the media dimension helpers without changing datasets or assertions. Developed in: WordPress/wordpress-develop#15270, WordPress/wordpress-develop#15308, WordPress/wordpress-develop#15309, WordPress/wordpress-develop#15310, WordPress/wordpress-develop#15311 Props shailu25, rejaulalomkhan, devmuhib, huzaifaalmesbah. See #66211. Built from https://develop.svn.wordpress.org/trunk@65162 git-svn-id: http://core.svn.wordpress.org/trunk@64311 1a063a9b-81f0-0310-95a4-ce76da25c4cd
|
PR #15311 landed in https://core.trac.wordpress.org/changeset/65162 |
Under Trac ticket #66211 and following committer guidance (Trac #66211 comment 109) to consolidate changes per directory/file, this PR updates all remaining data provider methods across
tests/phpunit/tests/media.phpto bepublic static.Trac ticket: https://core.trac.wordpress.org/ticket/66211
What
Declare 23 data provider methods and 2 static helpers as
public static(orprivate static) intests/phpunit/tests/media.php:data_attachment_permalinks_based_on_parent_status()data_autoembed()data_get_filters_with_do_shortcode_callback()data_image_converted_to_other_format_has_correct_filename()data_image_with_existing_auto_sizes()data_provider_data_provider_to_test_wp_enqueue_img_auto_sizes_contain_css_fix()data_provider_fetchpriority_values()data_provider_to_test_wp_img_tag_add_auto_sizes()data_special_contexts_for_the_content()data_special_contexts_for_the_content_wp_get_loading_attr_default()data_wp_get_attachment_image_decoding_attr()data_wp_get_loading_attr_default()data_wp_get_loading_attr_default_before_and_no_loop()data_wp_get_loading_optimization_attributes_arbitrary_contexts()data_wp_get_loading_optimization_attributes_check_allowed_tags()data_wp_get_loading_optimization_attributes_header_context()data_wp_get_loading_optimization_attributes_min_required_attrs()data_wp_lazy_loading_enabled_context_defaults()data_wp_lazy_loading_enabled_tag_name_defaults()data_wp_maybe_add_fetchpriority_high_attr()data_wp_prepare_attachment_for_js_filesize()data_wp_prepare_attachment_for_js_filesize_falls_back_to_the_file()data_wp_prepare_attachment_for_js_unusable_full_size()get_width_height_for_high_priority()andget_insufficient_width_height_for_high_priority()private staticand called them viaself::.Why
PHPUnit 10+ requires data providers to be
public static. Declaring them static prepares the test suite for modern PHPUnit versions without altering test behavior or assertion coverage.Testing Instructions
Run the test suite and coding standards check:
All 564 tests (1578 assertions) pass cleanly.