Skip to content

Tests: Modernize PHPUnit tests in tests/phpunit/tests/wp-includes/functions/ - Trac #53010, #65208 - #13585

Open
pbearne wants to merge 9 commits into
WordPress:trunkfrom
pbearne:53010-functions
Open

pbearne wants to merge 9 commits into
WordPress:trunkfrom
pbearne:53010-functions

Conversation

@pbearne

@pbearne pbearne commented Sep 17, 2026

Copy link
Copy Markdown

This patch should be applied after https://core.trac.wordpress.org/ticket/65252

Modernizes and reorganizes the PHPUnit test suite for wp-includes/functions.php located in tests/phpunit/tests/wp-includes/functions/ to improve maintainability, automated test reliability, and compatibility with modern PHPUnit versions (10, 11, and 12), following Trac tickets #53010, #65208, and #62004:

  • Directory & File Restructuring: Moved tests from tests/phpunit/tests/functions/ to tests/phpunit/tests/wp-includes/functions/ using git mv to preserve git history.
  • Granular Single-Unit Test Classes: Split multi-unit test files (anonymization.php, cleanDirsizeCache.php, maybeSerialize.php, referer.php, underscoreReturn.php, wpListUtil.php, xmlrpc.php) into dedicated, single-unit test classes.
  • Naming Standards: Renamed all 128 test files and test classes to PascalCase ending with the Test suffix, ensuring an exact case-sensitive match between class and file names.
  • PSR-4 Namespacing: Applied the WordPress\Tests\WP_Includes\Functions namespace across all test classes with explicit use imports for WP_UnitTestCase and other test dependencies.
  • Class-Level @covers Annotations: Consolidated precise @covers tags into opening class docblocks and removed method-level @covers tags.
  • Assertion Strictness & Isolation: Validated all 1,420 tests passing in standard execution order and across multiple randomized seeds (--order-by=random --random-order-seed=1 / 2) to ensure complete test isolation and zero state pollution.

Trac ticket: https://core.trac.wordpress.org/ticket/53010
See also: https://core.trac.wordpress.org/ticket/65208, https://core.trac.wordpress.org/ticket/62004

Use of AI Tools

AI assistance: Yes
Tool(s): Junie
Model(s): gemini-3.7-flash
Used for: Automated file splitting, PSR-4 namespacing, @covers docblock consolidation, and test execution validation.

@github-actions

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.

Unlinked Accounts

The following contributors have not linked their GitHub and WordPress.org accounts: @pbearne@git.wordpress.org.

Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases.

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

Props pbearne.

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

@pbearne

pbearne commented Sep 17, 2026

Copy link
Copy Markdown
Author

as we are deleting/moving files this will some help to merge

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.

1 participant