Skip to content

Docs: Add missing @global annotations in abstract-testcase.php#10841

Open
noruzzamans wants to merge 11 commits intoWordPress:trunkfrom
noruzzamans:fix/missing-global-tags
Open

Docs: Add missing @global annotations in abstract-testcase.php#10841
noruzzamans wants to merge 11 commits intoWordPress:trunkfrom
noruzzamans:fix/missing-global-tags

Conversation

@noruzzamans
Copy link

@noruzzamans noruzzamans commented Feb 2, 2026

Trac Ticket: https://core.trac.wordpress.org/ticket/64224

Why this change?

This change adds missing @global documentation tags to functions in
tests/phpunit/includes/abstract-testcase.php

By documenting the global variables used within these functions (such as $wpdb, $wp_rewrite, $wp_the_query, etc.), we align the test suite's codebase with the WordPress PHP Documentation Standards. This improves code clarity and enables better static analysis for the unit testing framework.

Files Changed:
tests/phpunit/includes/abstract-testcase.php

@github-actions
Copy link

github-actions bot commented Feb 2, 2026

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 noruzzaman, mukesh27, westonruter, shailu25, huzaifaalmesbah.

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

@github-actions
Copy link

github-actions bot commented Feb 2, 2026

Test using WordPress Playground

The changes in this pull request can previewed and tested using a WordPress Playground instance.

WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

Some things to be aware of

  • The Plugin and Theme Directories cannot be accessed within Playground.
  • All changes will be lost when closing a tab with a Playground instance.
  • All changes will be lost when refreshing the page.
  • A fresh instance is created each time the link below is clicked.
  • Every time this pull request is updated, a new ZIP file containing all changes is created. If changes are not reflected in the Playground instance,
    it's possible that the most recent build failed, or has not completed. Check the list of workflow runs to be sure.

For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation.

Test this pull request with WordPress Playground.

* @deprecated 0.71 Use get_the_category_by_ID()
* @see get_the_category_by_ID()
*
* @global int $currentcat
Copy link
Member

Choose a reason for hiding this comment

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

No needs to edit/update deprecated functions as it was not used

* @since 6.4.0 The `$revisions_enabled` argument was added to the arguments array.
* @since 6.7.0 The `label` argument was added to the arguments array.
*
* @global array $wp_meta_keys Global registry for meta keys.
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Author

Choose a reason for hiding this comment

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

@mukeshpanchal27 I have updated the @global documentation in abstract-testcase.php and reverted the changes in deprecated.php as suggested.

Comment on lines 371 to 374
* @global array $wp_filter Stores all of the filters and actions.
* @global array $wp_actions Stores the number of times each action was triggered.
* @global array $wp_filters Stores the number of times each filter was triggered.
* @global array $wp_current_filter Stores the list of current filters with the current one last.
Copy link
Member

Choose a reason for hiding this comment

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

I don't think a these descriptions should start with a verb ("Stores"). They should be nouns. So strip the "Stores" off.

Copy link
Member

Choose a reason for hiding this comment

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

+1

Comment on lines 394 to 397
* @global array $wp_filter Stores all of the filters and actions.
* @global array $wp_actions Stores the number of times each action was triggered.
* @global array $wp_filters Stores the number of times each filter was triggered.
* @global array $wp_current_filter Stores the list of current filters with the current one last.
Copy link
Member

Choose a reason for hiding this comment

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

Ditto.

noruzzamans and others added 2 commits February 8, 2026 07:41
Co-authored-by: Weston Ruter <westonruter@gmail.com>
Co-authored-by: Weston Ruter <westonruter@gmail.com>
@shail-mehta
Copy link
Member

shail-mehta commented Feb 8, 2026

@noruzzamans Could you please resolve conflicts?

Comment on lines 163 to 166
* @global wpdb $wpdb WordPress database abstraction object.
* @global WP_Query $wp_the_query Main WordPress query object.
* @global WP_Query $wp_query WordPress query object.
* @global WP $wp WordPress environment object.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* @global wpdb $wpdb WordPress database abstraction object.
* @global WP_Query $wp_the_query Main WordPress query object.
* @global WP_Query $wp_query WordPress query object.
* @global WP $wp WordPress environment object.
* @global wpdb $wpdb WordPress database abstraction object.
* @global WP_Query $wp_the_query Main WordPress query object.
* @global WP_Query $wp_query WordPress query object.
* @global WP $wp WordPress environment object.

@huzaifaalmesbah
Copy link
Member

It looks like this PR may already have been committed:

@noruzzamans
Copy link
Author

@shail-mehta @westonruter @mukeshpanchal27 @huzaifaalmesbah Thanks for review. I have updated all changes. if need any changes please let me know. Thanks

Copy link
Member

@mukeshpanchal27 mukeshpanchal27 left a comment

Choose a reason for hiding this comment

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

Let’s update the PR title and description, as they’re outdated now.

noruzzamans and others added 2 commits February 9, 2026 12:42
Co-authored-by: Mukesh Panchal <mukeshpanchal27@users.noreply.github.com>
@noruzzamans noruzzamans changed the title Docs: Add missing @global annotations in meta.php and deprecated.php Docs: Add missing @global annotations in abstract-testcase.php Feb 9, 2026
@noruzzamans
Copy link
Author

Let’s update the PR title and description, as they’re outdated now.

@mukeshpanchal27 Thanks. I have updated the title and description based on your suggestion.

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.

5 participants