[wp-trac] [WordPress Trac] #29827: Leftover taxonomies break later tests

WordPress Trac noreply at wordpress.org
Thu Oct 9 00:57:29 UTC 2014


#29827: Leftover taxonomies break later tests
------------------------------+---------------------------
 Reporter:  boonebgorges      |       Owner:  boonebgorges
     Type:  defect (bug)      |      Status:  closed
 Priority:  normal            |   Milestone:  4.1
Component:  Build/Test Tools  |     Version:
 Severity:  normal            |  Resolution:  fixed
 Keywords:  2nd-opinion       |     Focuses:
------------------------------+---------------------------
Changes (by boonebgorges):

 * status:  accepted => closed
 * resolution:   => fixed


Comment:

 In [changeset:"29860"]:
 {{{
 #!CommitTicketReference repository="" revision="29860"
 Reset post types and taxonomies before each unit test.

 Registering a post type or taxonomy during a unit test causes
 modifications to
 global variables. If the test fails to clean up these globals - either by
 neglecting to call _unregister_post_type()/_unregister_taxonomy() at all
 or by
 failing before getting a chance to do so - tests that run later in the
 suite
 can fail, leading to much gnashing of teeth. Wiping all taxonomies and
 restoring to the defaults before each test ensures that we always start
 with a
 clean slate.

 Fixes #29827.
 }}}

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


More information about the wp-trac mailing list