Repository navigation
Tests: Add unit tests for wp_get_active_and_valid_themes() - #14482
shail-mehta wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
Static review found no blocking issues in this test-only change; tests were not executed.
No open issues 🎉
What changed in this PR
Adds dedicated PHPUnit coverage for wp_get_active_and_valid_themes() under ticket #65819. No production code changes.
Changes:
- Tests parent and child theme paths.
- Covers installation mode and the
wp-activate.phpexception. - Verifies paused-theme handling in recovery mode.
| File | Description |
|---|---|
tests/phpunit/tests/load/wpGetActiveAndValidThemes.php |
Adds six tests with state setup and cleanup. |
Review effort: Balanced
|
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 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. |
| global $wp_stylesheet_path, $wp_template_path; | ||
|
|
||
| $wp_template_path = get_theme_root() . '/twentytwentyone'; | ||
| $wp_stylesheet_path = get_theme_root() . '/twentytwentyfive'; |
There was a problem hiding this comment.
Optional: twentytwentyfive is not really a child theme of twentytwentyone. The test works because is_child_theme() only compares the two paths. A one-line comment saying that would help readers.
What
Trac ticket: #65819
Adds unit tests for
wp_get_active_and_valid_themes()intests/phpunit/tests/load/wpGetActiveAndValidThemes.php.Covers parent/child themes, installing mode,
wp-activate.php, and paused themes in recovery mode.Test-only change.
Why
This helper has had no dedicated PHPUnit coverage. Fits the #65819 missing-coverage track, and no open PR covers it.
How
wp-activate.phpTesting instructions
Use of AI Tools