Repository navigation
Tests: Add unit coverage for wp_get_ext_types() - #15275
shail-mehta wants to merge 1 commit into
Conversation
Add unit tests for default extension type keys, sample extensions, and the ext2type filter.\n\nSee #65819.
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for this test-only change adding PHPUnit coverage for wp_get_ext_types().
No open issues 🎉
What changed in this PR
Adds dedicated PHPUnit coverage for wp_get_ext_types() as part of the test cleanup in Trac #65819. No production code changes are included.
Changes:
- Adds a test class with an explicit
@covers ::wp_get_ext_typesannotation. - Checks default type keys and representative file extensions.
- Verifies that the
ext2typefilter can add a custom extension type.
| File | Description |
|---|---|
tests/phpunit/tests/functions/wpGetExtTypes.php |
Adds tests for default extension mappings and filter customization. |
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. 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. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
|
lancewillett
left a comment
There was a problem hiding this comment.
Literal extension membership catches map deletion that the existing self-derived extension loop misses. Existing filter coverage makes the added filter method optional duplication.
Local randomized single-site and multisite checks passed with related existing tests: 51 tests, 319 assertions across this five-PR batch (seed 15273). PHPCS passed.
Optional: Fold literal memberships into the existing test and omit the repeated filter exercise and full key-list assertion.
AI review · gpt-6
Verify `wp_get_ext_types()` includes representative extensions in the expected groups and respects the `ext2type` filter. Developed in: #15275 Props shailu25. See #65819. git-svn-id: https://develop.svn.wordpress.org/trunk@65139 602fd350-edb4-49c9-b593-d223f7449a82
Verify `wp_get_ext_types()` includes representative extensions in the expected groups and respects the `ext2type` filter. Developed in: WordPress/wordpress-develop#15275 Props shailu25. See #65819. Built from https://develop.svn.wordpress.org/trunk@65139 git-svn-id: http://core.svn.wordpress.org/trunk@64288 1a063a9b-81f0-0310-95a4-ce76da25c4cd
|
PR #15275 landed in https://core.trac.wordpress.org/changeset/65139 |
Trac ticket: #65819
What
Adds a dedicated PHPUnit class for
wp_get_ext_types(), covering default type keys, representative extensions, and theext2typefilter.Test-only; no production code changes.
Why
wp_get_ext_types()had no direct@coverscoverage. Small helper coverage fits the #65819 test cleanup track.How
Add
tests/phpunit/tests/functions/wpGetExtTypes.phpwith@covers ::wp_get_ext_types.Testing Instructions
npm run test:php -- --filter Tests_Functions_WpGetExtTypesnpm run test:php -- --filter Tests_Functions_WpGetExtTypes -c tests/phpunit/multisite.xmlnpm run test:php -- --filter Tests_Functions_WpGetExtTypes --order-by=randomnpm run test:php -- --group functionsUse of AI Tools