Skip to content

Tests: Add unit tests for wp_using_themes() - #14445

Open
shail-mehta wants to merge 1 commit into
WordPress:trunkfrom
shail-mehta:tests/65819-wp-using-themes
Open

shail-mehta wants to merge 1 commit into
WordPress:trunkfrom
shail-mehta:tests/65819-wp-using-themes

Conversation

@shail-mehta

Copy link
Copy Markdown
Member

What

Trac ticket: #65819

Adds unit tests for wp_using_themes() in tests/phpunit/tests/load/wpUsingThemes.php.

Covers WP_USE_THEMES behavior and the wp_using_themes filter, including override when the constant is true.

Test-only change.

Why

This helper controls whether themes should load for the current request and has had no dedicated PHPUnit coverage.

How

  • Cover undefined / true / false WP_USE_THEMES and filter overrides

Testing instructions

npm run test:php -- --filter Tests_Load_WpUsingThemes

Use of AI Tools

  • Cursor

Adds coverage for WP_USE_THEMES and the wp_using_themes filter.

See #65819.

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 tests cover the stated behavior with appropriate constant isolation, and no blocking issues were identified.

No open issues 🎉

What changed in this PR

Adds dedicated PHPUnit coverage for wp_using_themes(), with no production code changes.

Changes:

  • Tests undefined, true, and false WP_USE_THEMES states.
  • Tests filter overrides, including when the constant is true.
  • Isolates tests that define the constant in separate processes.
File Description
tests/​phpunit/​tests/​load/​wpUsingThemes.php Adds five tests for constant behavior and filter overrides.

Review effort: Balanced

@shail-mehta
shail-mehta marked this pull request as ready for review October 18, 2026 09:23
@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.

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.

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.

2 participants