[wp-trac] [WordPress Trac] #53651: unit test for wp_removable_query_args
WordPress Trac
noreply at wordpress.org
Mon Aug 16 14:42:04 UTC 2021
#53651: unit test for wp_removable_query_args
------------------------------+------------------------------
Reporter: pbearne | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Build/Test Tools | Version:
Severity: normal | Resolution:
Keywords: needs-unit-tests | Focuses:
------------------------------+------------------------------
Comment (by SergeyBiryukov):
This reminds me of comment:1:ticket:47701 and [45646] / #47701:
* [source:tags/5.8/tests/phpunit/tests/functions/wpGetMimeTypes.php].
I think something similar would be enough here:
* Make sure it returns an array.
* Make sure it's not empty.
* Make sure the filter works as expected.
* Make sure it reverts to the original array after removing the filter.
While the latter two steps might technically be out of scope here, I agree
that if the function result is supposed to run through a filter, testing
for that specifically seems like a good idea.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/53651#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list