[wp-trac] [WordPress Trac] #53651: unit test for wp_removable_query_args

WordPress Trac noreply at wordpress.org
Mon Aug 16 13:23:50 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 pbearne):

 @johnbillion

 Part of the drive is to have complete coverage for all functions.

 I agree it seems silly to test the that all the same values as this
 increases the maintenance as to add another value we would need to do it
 in two places.
 Would just checking that we get an array back be sufficient or should
 check the shape of the array as well?

 @jrf @hellofromtonya
 I have been struggling with how to make sure that the expected
 filter(actions) are in the functions.

 Filters and Actions are a key part of how WP works and a lot will break if
 they get changed.

 If the output of a function has a filter should we not check that is
 applied? A set of tests that doesn't check will still pass if the filter
 got renamed/deleted or an early return was added.

 Throught?

 Paul

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/53651#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list