Index: src/wp-includes/post.php
===================================================================
--- src/wp-includes/post.php	(revision 25653)
+++ src/wp-includes/post.php	(working copy)
@@ -3957,7 +3957,7 @@
 
 	$defaults = array('post_status' => 'inherit', 'post_type' => 'post', 'post_author' => $user_ID,
 		'ping_status' => get_option('default_ping_status'), 'post_parent' => 0, 'post_title' => '',
-		'menu_order' => 0, 'to_ping' =>  '', 'pinged' => '', 'post_password' => '',
+		'menu_order' => 0, 'to_ping' =>  '', 'pinged' => '', 'post_password' => '', 'post_content' => '',
 		'guid' => '', 'post_content_filtered' => '', 'post_excerpt' => '', 'import_id' => 0, 'context' => '');
 
 	$object = wp_parse_args($object, $defaults);
@@ -4029,7 +4029,7 @@
 	else
 		$to_ping = '';
 
-	if ( isset($post_parent) )
+	if ( isset( $post_parent ) )
 		$post_parent = (int) $post_parent;
 	else
 		$post_parent = 0;
Index: src/wp-includes/wp-db.php
===================================================================
--- src/wp-includes/wp-db.php	(revision 25653)
+++ src/wp-includes/wp-db.php	(working copy)
@@ -637,14 +637,10 @@
 		if ( ! isset( $collate ) )
 			$collate = $this->collate;
 		if ( $this->has_cap( 'collation' ) && ! empty( $charset ) ) {
-			if ( function_exists( 'mysql_set_charset' ) && $this->has_cap( 'set_charset' ) ) {
-				mysql_set_charset( $charset, $dbh );
-			} else {
-				$query = $this->prepare( 'SET NAMES %s', $charset );
-				if ( ! empty( $collate ) )
-					$query .= $this->prepare( ' COLLATE %s', $collate );
-				mysql_query( $query, $dbh );
-			}
+			$query = $this->prepare( 'SET NAMES %s', $charset );
+			if ( ! empty( $collate ) )
+				$query .= $this->prepare( ' COLLATE %s', $collate );
+			mysqli_query( $dbh, $query );
 		}
 	}
 
@@ -830,7 +826,7 @@
 		if ( is_null($dbh) )
 			$dbh = $this->dbh;
 
-		if ( !@mysql_select_db( $db, $dbh ) ) {
+		if ( ! @mysqli_select_db( $dbh, $db ) ) {
 			$this->ready = false;
 			wp_load_translations_early();
 			$this->bail( sprintf( __( '<h1>Can&#8217;t select database</h1>
@@ -866,9 +862,9 @@
 	}
 
 	/**
-	 * Real escape, using mysql_real_escape_string()
+	 * Real escape, using mysqli_real_escape_string()
 	 *
-	 * @see mysql_real_escape_string()
+	 * @see mysql_reali_escape_string()
 	 * @since 2.8.0
 	 * @access private
 	 *
@@ -877,7 +873,7 @@
 	 */
 	function _real_escape( $string ) {
 		if ( $this->dbh )
-			return mysql_real_escape_string( $string, $this->dbh );
+			return mysqli_real_escape_string( $this->dbh, $string );
 
 		$class = get_class( $this );
 		_doing_it_wrong( $class, "$class must set a database connection for use with escaping.", E_USER_NOTICE );
@@ -1019,7 +1015,7 @@
 		global $EZSQL_ERROR;
 
 		if ( !$str )
-			$str = mysql_error( $this->dbh );
+			$str = mysqli_error( $this->dbh );
 		$EZSQL_ERROR[] = array( 'query' => $this->last_query, 'error_str' => $str );
 
 		if ( $this->suppress_errors )
@@ -1123,7 +1119,7 @@
 		$this->last_error  = '';
 
 		if ( is_resource( $this->result ) )
-			mysql_free_result( $this->result );
+			mysqli_free_result( $this->result );
 	}
 
 	/**
@@ -1135,13 +1131,14 @@
 
 		$this->is_mysql = true;
 
-		$new_link = defined( 'MYSQL_NEW_LINK' ) ? MYSQL_NEW_LINK : true;
 		$client_flags = defined( 'MYSQL_CLIENT_FLAGS' ) ? MYSQL_CLIENT_FLAGS : 0;
 
 		if ( WP_DEBUG ) {
-			$this->dbh = mysql_connect( $this->dbhost, $this->dbuser, $this->dbpassword, $new_link, $client_flags );
+			$this->dbh = mysqli_init();
+			mysqli_real_connect( $this->dbh, $this->dbhost, $this->dbuser, $this->dbpassword, $this->dbname, null, null, $client_flags );
 		} else {
-			$this->dbh = @mysql_connect( $this->dbhost, $this->dbuser, $this->dbpassword, $new_link, $client_flags );
+			$this->dbh = @mysqli_init();
+			@mysql_real_connect( $this->dbh, $this->dbhost, $this->dbuser, $this->dbpassword, $this->dbname, null, null, $client_flags );
 		}
 
 		if ( !$this->dbh ) {
@@ -1202,14 +1199,14 @@
 		if ( defined( 'SAVEQUERIES' ) && SAVEQUERIES )
 			$this->timer_start();
 
-		$this->result = @mysql_query( $query, $this->dbh );
+		$this->result = @mysqli_query( $this->dbh, $query );
 		$this->num_queries++;
 
 		if ( defined( 'SAVEQUERIES' ) && SAVEQUERIES )
 			$this->queries[] = array( $query, $this->timer_stop(), $this->get_caller() );
 
 		// If there is an error then take note of it..
-		if ( $this->last_error = mysql_error( $this->dbh ) ) {
+		if ( $this->last_error = mysqli_error( $this->dbh ) ) {
 			// Clear insert_id on a subsequent failed insert.
 			if ( $this->insert_id && preg_match( '/^\s*(insert|replace)\s/i', $query ) )
 				$this->insert_id = 0;
@@ -1221,16 +1218,16 @@
 		if ( preg_match( '/^\s*(create|alter|truncate|drop)\s/i', $query ) ) {
 			$return_val = $this->result;
 		} elseif ( preg_match( '/^\s*(insert|delete|update|replace)\s/i', $query ) ) {
-			$this->rows_affected = mysql_affected_rows( $this->dbh );
+			$this->rows_affected = mysqli_affected_rows( $this->dbh );
 			// Take note of the insert_id
 			if ( preg_match( '/^\s*(insert|replace)\s/i', $query ) ) {
-				$this->insert_id = mysql_insert_id($this->dbh);
+				$this->insert_id = mysqli_insert_id( $this->dbh );
 			}
 			// Return number of rows affected
 			$return_val = $this->rows_affected;
 		} else {
 			$num_rows = 0;
-			while ( $row = @mysql_fetch_object( $this->result ) ) {
+			while ( $row = @mysqli_fetch_object( $this->result ) ) {
 				$this->last_result[$num_rows] = $row;
 				$num_rows++;
 			}
@@ -1574,8 +1571,8 @@
 		if ( $this->col_info )
 			return;
 
-		for ( $i = 0; $i < @mysql_num_fields( $this->result ); $i++ ) {
-			$this->col_info[ $i ] = @mysql_fetch_field( $this->result, $i );
+		for ( $i = 0; $i < @mysqli_num_fields( $this->result ); $i++ ) {
+			$this->col_info[ $i ] = @mysqli_fetch_field( $this->result );
 		}
 	}
 
@@ -1747,6 +1744,6 @@
 	 * @return false|string false on failure, version number on success
 	 */
 	function db_version() {
-		return preg_replace( '/[^0-9.].*/', '', mysql_get_server_info( $this->dbh ) );
+		return preg_replace( '/[^0-9.].*/', '', mysqli_get_server_info( $this->dbh ) );
 	}
 }
Index: tests/phpunit/includes/factory.php
===================================================================
--- tests/phpunit/includes/factory.php	(revision 25653)
+++ tests/phpunit/includes/factory.php	(working copy)
@@ -122,6 +122,7 @@
 			'comment_author' => new WP_UnitTest_Generator_Sequence( 'Commenter %s' ),
 			'comment_author_url' => new WP_UnitTest_Generator_Sequence( 'http://example.com/%s/' ),
 			'comment_approved' => 1,
+			'comment_content' => 'This is a comment'
 		);
 	}
 
