[wp-trac] [WordPress Trac] #29827: Leftover taxonomies break later tests
WordPress Trac
noreply at wordpress.org
Fri Oct 10 11:57:24 UTC 2014
#29827: Leftover taxonomies break later tests
------------------------------+---------------------------
Reporter: boonebgorges | Owner: boonebgorges
Type: defect (bug) | Status: reopened
Priority: normal | Milestone: 4.1
Component: Build/Test Tools | Version:
Severity: normal | Resolution:
Keywords: 2nd-opinion | Focuses:
------------------------------+---------------------------
Comment (by danielbachhuber):
> Can you share a specific example so I can have a closer look?
My immediate example is from a private client repo, so I've emailed you a
screenshot.
Essentially, the configuration is this:
1. Repo comprises a custom theme.
1. Bootstrap file uses a filter on `pre_option_stylesheet` and
`pre_option_template` to load the theme.
1. Tests extend `WP_UnitTestCase`.
1. Theme defines post types and taxonomies on `init`.
1. Theme also loads Co-Authors Plus, which defines a taxonomy and post
type.
1. First test passes because the `init` hook fired and registers
everything. Subsequent tests failboat in basically every way they can
because the custom post types and taxonomies are no longer registered.
Re-registering everything in `setUp()` (well, calling the methods that do)
fixes things cleanly, but it's a bit tedious.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/29827#comment:10>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list