[wp-trac] [WordPress Trac] #35987: Unit test: wp_ext2type
WordPress Trac
noreply at wordpress.org
Mon Feb 29 16:52:54 UTC 2016
#35987: Unit test: wp_ext2type
-------------------------+-----------------------------
Reporter: borgesbruno | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Future Release
Component: Media | Version:
Severity: normal | Resolution:
Keywords: needs-patch | Focuses:
-------------------------+-----------------------------
Changes (by boonebgorges):
* keywords: has-patch has-unit-tests => needs-patch
* milestone: Awaiting Review => Future Release
Comment:
Thanks for the patch.
Your tests perform spot-checks only. But I'm thinking that this is a case
where we may want to refactor slightly to allow for complete test
coverage. See, eg, `wp_get_mime_types()`, which is just a wrapper for a
filtered array. How about introducing `wp_get_ext_types()`, moving the
array there, and then using it as a `dataProvider`? We can then also have
targeted tests for the peculiar behavior of `in_array()`, such as the
'JPG' =>
--
Ticket URL: <https://core.trac.wordpress.org/ticket/35987#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list