Skip to content

Tests/admin/includes/template: Rename get_media_states test class - #16391

Closed
shail-mehta wants to merge 1 commit into
WordPress:trunkfrom
shail-mehta:tests/65208-admin-includes-template-get-media-states
Closed

shail-mehta wants to merge 1 commit into
WordPress:trunkfrom
shail-mehta:tests/65208-admin-includes-template-get-media-states

Conversation

@shail-mehta

Copy link
Copy Markdown
Member

What

Trac Ticket: #65208

Renames tests/phpunit/tests/admin/includes/template/getMediaStates.php to Admin_Includes_Template_GetMediaStates_Test.php and updates the class from Tests_Admin_Includes_Template_GetMediaStates to Admin_Includes_Template_GetMediaStates_Test.

Why

filename and class name align with the method under test and end with _Test, consistent with recently landed admin renames. No test behavior changes.

How

  • Used git mv to preserve history
  • Renamed only the file and class
  • Left @covers ::get_media_states, groups, fixtures, and existing tests unchanged

Testing instructions

  1. Run:
npm run test:php -- --test-suffix .php --filter Admin_Includes_Template_GetMediaStates_Test
  1. Optionally run the admin template folder:
npm run test:php -- --test-suffix .php tests/phpunit/tests/admin/includes/template
  1. Confirm PHPUnit still discovers and runs the same cases as before the rename

Use of AI tools

  • Assisted by Cursor

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

No active review issues are reported for the test file and class naming alignment.

No open issues 🎉

What changed in this PR

Aligns the get_media_states test file and class names with the admin _Test naming convention, without changing test behavior.

Changes:

  • Renames the file and class to Admin_Includes_Template_GetMediaStates_Test.
  • Preserves coverage annotations, groups, fixtures, and existing tests.
File Description
tests/​phpunit/​tests/​admin/​includes/​template/​Admin_Includes_Template_GetMediaStates_Test.php Aligns the test file and class names with the _Test convention.

Review effort: Balanced

@shail-mehta
shail-mehta marked this pull request as ready for review December 2, 2026 17:55
@github-actions

github-actions Bot commented Dec 2, 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.

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

Props shailu25.

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


Props Bot commands

You can trigger Props Bot actions by commenting on this PR:

  • @propsbot add <username> to give props to a GitHub or WordPress.org user. Requires write access.
  • @propsbot remove <username> to leave a user out of the props. Requires write access.
  • @propsbot refresh to refresh this list. Adding the props-bot label works too.

@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.

Verified all 22 single-site cases (24 assertions) and 22 multisite cases (24 assertions) before and after the rename. PHPUnit discovered the same cases with the same assertion counts in randomized order. The coverage annotations and fixtures are preserved.

AI review · gpt-6.2-astra

wporg-sync pushed a commit that referenced this pull request Dec 2, 2026
…n test classes and files.

Developed in: #16387, #16391, #16394

Props shailu25, jrf, desrosj.
See #65208.


git-svn-id: https://develop.svn.wordpress.org/trunk@65868 602fd350-edb4-49c9-b593-d223f7449a82
wporg-sync pushed a commit to WordPress/WordPress that referenced this pull request Dec 2, 2026
@lancewillett

Copy link
Copy Markdown
Member

@lancewillett lancewillett moved this from In review to Done in WordPress Project Build Tooling Dec 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

3 participants