Opened 11 years ago
Closed 11 years ago
#28692 closed defect (bug) (fixed)
Polluted table_prefix and switched_stack in multisite unit tests
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 4.0 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Build/Test Tools | Keywords: | has-patch |
Focuses: | multisite | Cc: |
Description
At present, and seemingly since [27511], there are many test failures in multisite around various queries. Through these failures, I was seeing several Cannot use object of type WP_Error as array
messages appear because the tests were trying to use database tables that didn't exist due to a polluted $_wp_switched_stack
that still thought it was on site 67 after a tear down.
As of [28910], this gets even crazier and pollutes $table_prefix
so that we end up with queries for wptests_66_66_66_67_67_67_68_terms
, etc...
Attachments (2)
Change History (6)
#3
@
11 years ago
28692.2.diff wraps ms_is_switched()
with an is_multisite()
check so that our regular unit tests aren't completely broken due to a non-existent function.
Note: See
TracTickets for help on using
tickets.
28692.diff loops through
restore_current_blog()
on test tear down until we are back to the base site. It also resets the global$table_prefix
when testing multisite's bootstrap, as we includems-settings.php
repeatedly, which relies on this to be pretty clean.