Index: tests/phpunit/includes/testcase.php
===================================================================
--- tests/phpunit/includes/testcase.php	(revision 29797)
+++ tests/phpunit/includes/testcase.php	(working copy)
@@ -10,6 +10,8 @@
 	protected $caught_deprecated = array();
 	protected $expected_doing_it_wrong = array();
 	protected $caught_doing_it_wrong = array();
+	protected $registered_taxonomy = array();
+	protected $registered_post_type = array();
 
 	protected static $hooks_saved = array();
 	protected static $ignore_files;
@@ -40,6 +42,8 @@
 		$this->start_transaction();
 		$this->expectDeprecated();
 		add_filter( 'wp_die_handler', array( $this, 'get_wp_die_handler' ) );
+		add_action( 'registered_taxonomy', array( $this, 'object_registered' ) );
+		add_action( 'registered_post_type', array( $this, 'object_registered' ) );
 	}
 
 	function tearDown() {
@@ -57,6 +61,14 @@
 		remove_filter( 'query', array( $this, '_create_temporary_tables' ) );
 		remove_filter( 'query', array( $this, '_drop_temporary_tables' ) );
 		remove_filter( 'wp_die_handler', array( $this, 'get_wp_die_handler' ) );
+
+		foreach ( $registered_taxonomy as $tax ) {
+			_unregister_taxonomy( $tax );
+		}
+		foreach ( $registered_post_type as $pt ) {
+			_unregister_post_type( $pt );
+		}
+
 		$this->_restore_hooks();
 	}
 
@@ -103,7 +115,12 @@
 			}
 		}
 	}
-	
+
+	public function object_registered( $name ) {
+		$action = current_filter();
+		$this->$object_registered[] = $name;
+	}
+
 	function flush_cache() {
 		global $wp_object_cache;
 		$wp_object_cache->group_ops = array();
