diff --git tests/phpunit/includes/bootstrap.php tests/phpunit/includes/bootstrap.php
index ac715d814c..2225235463 100644
--- tests/phpunit/includes/bootstrap.php
+++ tests/phpunit/includes/bootstrap.php
@@ -111,6 +111,10 @@ require dirname( __FILE__ ) . '/testcase-xmlrpc.php';
 require dirname( __FILE__ ) . '/testcase-ajax.php';
 require dirname( __FILE__ ) . '/testcase-canonical.php';
 require dirname( __FILE__ ) . '/exceptions.php';
+require dirname( __FILE__ ) . '/class-mock-action.php';
+require dirname( __FILE__ ) . '/class-mock-class.php';
+require dirname( __FILE__ ) . '/class-test-xml-parser.php';
+require dirname( __FILE__ ) . '/class-wpdb-testing.php';
 require dirname( __FILE__ ) . '/utils.php';
 require dirname( __FILE__ ) . '/spy-rest-server.php';
 
diff --git tests/phpunit/includes/class-mock-action.php tests/phpunit/includes/class-mock-action.php
new file mode 100644
index 0000000000..0ad8aeeb46
--- /dev/null
+++ tests/phpunit/includes/class-mock-action.php
@@ -0,0 +1,110 @@
+<?php
+
+// helper class for testing code that involves actions and filters
+// typical use:
+// $ma = new MockAction();
+// add_action('foo', array(&$ma, 'action'));
+class MockAction {
+	var $events;
+	var $debug;
+
+	/**
+	 * PHP5 constructor.
+	 */
+	function __construct( $debug = 0 ) {
+		$this->reset();
+		$this->debug = $debug;
+	}
+
+	function reset() {
+		$this->events = array();
+	}
+
+	function current_filter() {
+		if (is_callable('current_filter'))
+			return current_filter();
+		global $wp_actions;
+		return end($wp_actions);
+	}
+
+	function action($arg) {
+		if ($this->debug) dmp(__FUNCTION__, $this->current_filter());
+		$args = func_get_args();
+		$this->events[] = array('action' => __FUNCTION__, 'tag'=>$this->current_filter(), 'args'=>$args);
+		return $arg;
+	}
+
+	function action2($arg) {
+		if ($this->debug) dmp(__FUNCTION__, $this->current_filter());
+
+		$args = func_get_args();
+		$this->events[] = array('action' => __FUNCTION__, 'tag'=>$this->current_filter(), 'args'=>$args);
+		return $arg;
+	}
+
+	function filter($arg) {
+		if ($this->debug) dmp(__FUNCTION__, $this->current_filter());
+
+		$args = func_get_args();
+		$this->events[] = array('filter' => __FUNCTION__, 'tag'=>$this->current_filter(), 'args'=>$args);
+		return $arg;
+	}
+
+	function filter2($arg) {
+		if ($this->debug) dmp(__FUNCTION__, $this->current_filter());
+
+		$args = func_get_args();
+		$this->events[] = array('filter' => __FUNCTION__, 'tag'=>$this->current_filter(), 'args'=>$args);
+		return $arg;
+	}
+
+	function filter_append($arg) {
+		if ($this->debug) dmp(__FUNCTION__, $this->current_filter());
+
+		$args = func_get_args();
+		$this->events[] = array('filter' => __FUNCTION__, 'tag'=>$this->current_filter(), 'args'=>$args);
+		return $arg . '_append';
+	}
+
+	function filterall($tag, $arg=NULL) {
+		// this one doesn't return the result, so it's safe to use with the new 'all' filter
+		if ($this->debug) dmp(__FUNCTION__, $this->current_filter());
+
+		$args = func_get_args();
+		$this->events[] = array('filter' => __FUNCTION__, 'tag'=>$tag, 'args'=>array_slice($args, 1));
+	}
+
+	// return a list of all the actions, tags and args
+	function get_events() {
+		return $this->events;
+	}
+
+	// return a count of the number of times the action was called since the last reset
+	function get_call_count($tag='') {
+		if ($tag) {
+			$count = 0;
+			foreach ($this->events as $e)
+				if ($e['action'] == $tag)
+					++$count;
+			return $count;
+		}
+		return count($this->events);
+	}
+
+	// return an array of the tags that triggered calls to this action
+	function get_tags() {
+		$out = array();
+		foreach ($this->events as $e) {
+			$out[] = $e['tag'];
+		}
+		return $out;
+	}
+
+	// return an array of args passed in calls to this action
+	function get_args() {
+		$out = array();
+		foreach ($this->events as $e)
+			$out[] = $e['args'];
+		return $out;
+	}
+}
diff --git tests/phpunit/includes/class-mock-class.php tests/phpunit/includes/class-mock-class.php
new file mode 100644
index 0000000000..c8b152667a
--- /dev/null
+++ tests/phpunit/includes/class-mock-class.php
@@ -0,0 +1,5 @@
+<?php
+/**
+ * Use to create objects by yourself
+ */
+class MockClass {};
diff --git tests/phpunit/includes/class-test-xml-parser.php tests/phpunit/includes/class-test-xml-parser.php
new file mode 100644
index 0000000000..7e7a2e1360
--- /dev/null
+++ tests/phpunit/includes/class-test-xml-parser.php
@@ -0,0 +1,50 @@
+<?php
+
+// convert valid xml to an array tree structure
+// kinda lame but it works with a default php 4 installation
+class testXMLParser {
+	var $xml;
+	var $data = array();
+
+	/**
+	 * PHP5 constructor.
+	 */
+	function __construct( $in ) {
+		$this->xml = xml_parser_create();
+		xml_set_object($this->xml, $this);
+		xml_parser_set_option($this->xml,XML_OPTION_CASE_FOLDING, 0);
+		xml_set_element_handler($this->xml, array($this, 'startHandler'), array($this, 'endHandler'));
+		xml_set_character_data_handler($this->xml, array($this, 'dataHandler'));
+		$this->parse($in);
+	}
+
+	function parse($in) {
+		$parse = xml_parse($this->xml, $in, true);
+		if (!$parse) {
+			trigger_error(sprintf("XML error: %s at line %d",
+				xml_error_string(xml_get_error_code($this->xml)),
+				xml_get_current_line_number($this->xml)), E_USER_ERROR);
+			xml_parser_free($this->xml);
+		}
+		return true;
+	}
+
+	function startHandler($parser, $name, $attributes) {
+		$data['name'] = $name;
+		if ($attributes) { $data['attributes'] = $attributes; }
+		$this->data[] = $data;
+	}
+
+	function dataHandler($parser, $data) {
+		$index = count($this->data) - 1;
+		@$this->data[$index]['content'] .= $data;
+	}
+
+	function endHandler($parser, $name) {
+		if (count($this->data) > 1) {
+			$data = array_pop($this->data);
+			$index = count($this->data) - 1;
+			$this->data[$index]['child'][] = $data;
+		}
+	}
+}
diff --git tests/phpunit/includes/class-wpdb-testing.php tests/phpunit/includes/class-wpdb-testing.php
new file mode 100644
index 0000000000..711fa65f52
--- /dev/null
+++ tests/phpunit/includes/class-wpdb-testing.php
@@ -0,0 +1,24 @@
+<?php
+/**
+ * Special class for exposing protected wpdb methods we need to access
+ */
+class wpdb_exposed_methods_for_testing extends wpdb {
+	public function __construct() {
+		global $wpdb;
+		$this->dbh = $wpdb->dbh;
+		$this->use_mysqli = $wpdb->use_mysqli;
+		$this->is_mysql = $wpdb->is_mysql;
+		$this->ready = true;
+		$this->field_types = $wpdb->field_types;
+		$this->charset = $wpdb->charset;
+
+		$this->dbuser = $wpdb->dbuser;
+		$this->dbpassword = $wpdb->dbpassword;
+		$this->dbname = $wpdb->dbname;
+		$this->dbhost = $wpdb->dbhost;
+	}
+
+	public function __call( $name, $arguments ) {
+		return call_user_func_array( array( $this, $name ), $arguments );
+	}
+}
diff --git tests/phpunit/includes/utils.php tests/phpunit/includes/utils.php
index 396edaebb3..514cabe95a 100644
--- tests/phpunit/includes/utils.php
+++ tests/phpunit/includes/utils.php
@@ -29,164 +29,6 @@ function strip_ws($txt) {
 	return trim(join("\n", $result));
 }
 
-// helper class for testing code that involves actions and filters
-// typical use:
-// $ma = new MockAction();
-// add_action('foo', array(&$ma, 'action'));
-class MockAction {
-	var $events;
-	var $debug;
-
-	/**
-	 * PHP5 constructor.
-	 */
-	function __construct( $debug = 0 ) {
-		$this->reset();
-		$this->debug = $debug;
-	}
-
-	function reset() {
-		$this->events = array();
-	}
-
-	function current_filter() {
-		if (is_callable('current_filter'))
-			return current_filter();
-		global $wp_actions;
-		return end($wp_actions);
-	}
-
-	function action($arg) {
-if ($this->debug) dmp(__FUNCTION__, $this->current_filter());
-		$args = func_get_args();
-		$this->events[] = array('action' => __FUNCTION__, 'tag'=>$this->current_filter(), 'args'=>$args);
-		return $arg;
-	}
-
-	function action2($arg) {
-if ($this->debug) dmp(__FUNCTION__, $this->current_filter());
-
-		$args = func_get_args();
-		$this->events[] = array('action' => __FUNCTION__, 'tag'=>$this->current_filter(), 'args'=>$args);
-		return $arg;
-	}
-
-	function filter($arg) {
-if ($this->debug) dmp(__FUNCTION__, $this->current_filter());
-
-		$args = func_get_args();
-		$this->events[] = array('filter' => __FUNCTION__, 'tag'=>$this->current_filter(), 'args'=>$args);
-		return $arg;
-	}
-
-	function filter2($arg) {
-if ($this->debug) dmp(__FUNCTION__, $this->current_filter());
-
-		$args = func_get_args();
-		$this->events[] = array('filter' => __FUNCTION__, 'tag'=>$this->current_filter(), 'args'=>$args);
-		return $arg;
-	}
-
-	function filter_append($arg) {
-if ($this->debug) dmp(__FUNCTION__, $this->current_filter());
-
-		$args = func_get_args();
-		$this->events[] = array('filter' => __FUNCTION__, 'tag'=>$this->current_filter(), 'args'=>$args);
-		return $arg . '_append';
-	}
-
-	function filterall($tag, $arg=NULL) {
-	// this one doesn't return the result, so it's safe to use with the new 'all' filter
-if ($this->debug) dmp(__FUNCTION__, $this->current_filter());
-
-		$args = func_get_args();
-		$this->events[] = array('filter' => __FUNCTION__, 'tag'=>$tag, 'args'=>array_slice($args, 1));
-	}
-
-	// return a list of all the actions, tags and args
-	function get_events() {
-		return $this->events;
-	}
-
-	// return a count of the number of times the action was called since the last reset
-	function get_call_count($tag='') {
-		if ($tag) {
-			$count = 0;
-			foreach ($this->events as $e)
-				if ($e['action'] == $tag)
-					++$count;
-			return $count;
-		}
-		return count($this->events);
-	}
-
-	// return an array of the tags that triggered calls to this action
-	function get_tags() {
-		$out = array();
-		foreach ($this->events as $e) {
-			$out[] = $e['tag'];
-		}
-		return $out;
-	}
-
-	// return an array of args passed in calls to this action
-	function get_args() {
-		$out = array();
-		foreach ($this->events as $e)
-			$out[] = $e['args'];
-		return $out;
-	}
-}
-
-// convert valid xml to an array tree structure
-// kinda lame but it works with a default php 4 installation
-class testXMLParser {
-	var $xml;
-	var $data = array();
-
-	/**
-	 * PHP5 constructor.
-	 */
-	function __construct( $in ) {
-		$this->xml = xml_parser_create();
-		xml_set_object($this->xml, $this);
-		xml_parser_set_option($this->xml,XML_OPTION_CASE_FOLDING, 0);
-		xml_set_element_handler($this->xml, array($this, 'startHandler'), array($this, 'endHandler'));
-		xml_set_character_data_handler($this->xml, array($this, 'dataHandler'));
-		$this->parse($in);
-	}
-
-	function parse($in) {
-		$parse = xml_parse($this->xml, $in, true);
-		if (!$parse) {
-			trigger_error(sprintf("XML error: %s at line %d",
-			xml_error_string(xml_get_error_code($this->xml)),
-			xml_get_current_line_number($this->xml)), E_USER_ERROR);
-			xml_parser_free($this->xml);
-		}
-		return true;
-	}
-
-	function startHandler($parser, $name, $attributes) {
-		$data['name'] = $name;
-		if ($attributes) { $data['attributes'] = $attributes; }
-		$this->data[] = $data;
-	}
-
-	function dataHandler($parser, $data) {
-		$index = count($this->data) - 1;
-		@$this->data[$index]['content'] .= $data;
-	}
-
-	function endHandler($parser, $name) {
-		if (count($this->data) > 1) {
-			$data = array_pop($this->data);
-			$index = count($this->data) - 1;
-			$this->data[$index]['child'][] = $data;
-		}
-	}
-}
-
 function xml_to_array($in) {
 	$p = new testXMLParser($in);
 	return $p->data;
@@ -286,11 +128,6 @@ function gen_tests_array($name, $array) {
 }
 
 /**
- * Use to create objects by yourself
- */
-class MockClass {};
-
-/**
  * Drops all tables from the WordPress database
  */
 function drop_tables() {
@@ -378,30 +215,6 @@ function _clean_term_filters() {
 }
 
 /**
- * Special class for exposing protected wpdb methods we need to access
- */
-class wpdb_exposed_methods_for_testing extends wpdb {
-	public function __construct() {
-		global $wpdb;
-		$this->dbh = $wpdb->dbh;
-		$this->use_mysqli = $wpdb->use_mysqli;
-		$this->is_mysql = $wpdb->is_mysql;
-		$this->ready = true;
-		$this->field_types = $wpdb->field_types;
-		$this->charset = $wpdb->charset;
-
-		$this->dbuser = $wpdb->dbuser;
-		$this->dbpassword = $wpdb->dbpassword;
-		$this->dbname = $wpdb->dbname;
-		$this->dbhost = $wpdb->dbhost;
-	}
-
-	public function __call( $name, $arguments ) {
-		return call_user_func_array( array( $this, $name ), $arguments );
-	}
-}
-
-/**
  * Determine approximate backtrack count when running PCRE.
  *
  * @return int The backtrack count.
