[wp-trac] [WordPress Trac] #33867: Unit tests to protected against breaking pluggable function changes

WordPress Trac noreply at wordpress.org
Mon Sep 14 16:49:41 UTC 2015


#33867: Unit tests to protected against breaking pluggable function changes
------------------------------+-----------------
 Reporter:  johnbillion       |      Owner:
     Type:  enhancement       |     Status:  new
 Priority:  normal            |  Milestone:  4.4
Component:  Build/Test Tools  |    Version:
 Severity:  normal            |   Keywords:
  Focuses:                    |
------------------------------+-----------------
 In [33023] and [33620], the parameters of the pluggable
 `wp_new_user_notification()` function were changed, which caused breakage.
 See #33654.

 We can introduce unit tests which protect us against this by using
 reflection to compare the functions in pluggable.php against an array of
 expected signatures (well, parameter names and default values at least).
 That way, if a pluggable function's parameters are changed, the unit tests
 will fail.

 It's not fool-proof (a parameter can be re-purposed without having its
 name or default value changed), but it gets us a long way.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/33867>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list