Index: tests/post/revisions.php
===================================================================
--- tests/post/revisions.php	(revision 1245)
+++ tests/post/revisions.php	(working copy)
@@ -17,9 +17,8 @@
 	}
 
 	/**
-	 * Note: Test needs reviewing when #16215 is fixed because I'm not sure the test current tests the "correct" behavior
 	 * @ticket 20982
-	 * @ticket 16215
+	 * "Restoring post revisions does not update _edit_last"
 	 */
 	function test_revision_restore_updates_edit_last_post_meta() {
 		$admin_user_id = $this->factory->user->create( array( 'role' => 'administrator' ) );
@@ -29,30 +28,66 @@
 		//create a post as Author
 		wp_set_current_user( $author_user_id );
 		$post_id = $this->factory->post->create( array( 'post_type' => 'post', 'post_content' => 'I cant spel werds.' ) );
+		sleep( 1 );
 
 		//update post as Editor
 		wp_set_current_user( $editor_user_id );
 		wp_update_post( array( 'post_content' => 'The Editor was in fixing your typos.', 'ID' => $post_id ) );
+		sleep( 1 );
 
 		//restore back as Admin
 		wp_set_current_user( $admin_user_id );
 		$revisions = wp_get_post_revisions( $post_id );
-		$this->assertCount( 1, $revisions );
 
 		$lastrevision = end( $revisions );
-		$this->assertEquals( 'I cant spel werds.', $lastrevision->post_content );
-		// #16215
-		$this->assertEquals( $author_user_id , $lastrevision->post_author);
 
 		wp_restore_post_revision( $lastrevision->ID );
 
-		//is post_meta correctly set to revision author
-		$this->assertEquals( $author_user_id, get_post_meta( $post_id, '_edit_last', true ) ); //after restoring user
+		//is post_meta correctly set to the current admin - the user who restored the post
+		$this->assertEquals( $admin_user_id, get_post_meta( $post_id, '_edit_last', true ) ); //after restoring user
 
 		wp_set_current_user( 0 );
 	}
 
 	/**
+	 * @ticket 16215
+	 * "Post Revision history displays the incorrect author"
+	 */
+	function test_revision_history_author_correct() {
+		$admin_user_id = $this->factory->user->create( array( 'role' => 'administrator' ) );
+		$editor_user_id = $this->factory->user->create( array( 'role' => 'editor' ) );
+		$author_user_id = $this->factory->user->create( array( 'role' => 'author' ) );
+
+		//create a post as Author
+		wp_set_current_user( $author_user_id );
+		$post_id = $this->factory->post->create( array( 'post_type' => 'post', 'post_content' => 'I cant spel werds.' ) );
+		//a pause is required because additional revivions will not be saved if the timestamp hasn't changed
+		sleep( 1 );
+
+		//update post as Editor
+		wp_set_current_user( $editor_user_id );
+		wp_update_post( array( 'post_content' => 'The Editor was in fixing your typos.', 'ID' => $post_id ) );
+		sleep( 1 );//pause after saving
+
+		//update post as author_user_id
+		wp_set_current_user( $author_user_id );
+		wp_update_post( array( 'post_content' => 'The User edited last.', 'ID' => $post_id ) );
+
+
+		wp_set_current_user( $admin_user_id );
+		$revisions = wp_get_post_revisions( $post_id );
+		$this->assertCount( 3, $revisions ); //inital save, revision 1 and current version
+
+		//verify that the last revision in the revision table
+		//matches the current post content
+		$lastrevision = array_shift( $revisions );
+
+		$this->assertEquals( 'The User edited last.', $lastrevision->post_content );
+
+		wp_set_current_user( 0 );
+	}
+
+	/**
 	* @ticket 7392
 	* @ticket 9843
 	*/
@@ -87,22 +122,22 @@
 		add_filter( 'wp_save_post_revision_check_for_changes', '__return_false' );
 
 		$post_id = $this->factory->post->create( array( 'post_title' => 'some-post', 'post_type' => 'post', 'post_content' => 'some_content' ) );
-		
+
 		wp_update_post( array( 'post_content'	=> 'some updated content', 'ID' => $post_id ) );	//1st revision
 		$this->assertCount( 1, wp_get_post_revisions( $post_id ) );
-		
+
 		//update the post
 		wp_update_post( array( 'post_content'	=> 'new update for some updated content', 'ID' => $post_id ) );	//2nd revision
 		$this->assertCount( 2, wp_get_post_revisions( $post_id ) );
-		
+
 		//next try to save another identical update, tests for patch that prevents storing duplicates
 		wp_update_post( array( 'post_content'	=> 'new update for some updated content', 'ID' => $post_id ) );	//content unchanged, shouldn't save
 		$this->assertCount( 3, wp_get_post_revisions( $post_id ) );
-		
+
 		//next try to save another update, same content, but new ttile, should save revision
 		wp_update_post( array( 'post_title' => 'some-post-changed', 'post_content'	=> 'new update for some updated content', 'ID' => $post_id ) );
 		$this->assertCount( 4, wp_get_post_revisions( $post_id ) );
-		
+
 		//next try to save another identical update
 		wp_update_post( array( 'post_title' => 'some-post-changed', 'post_content'	=> 'new update for some updated content', 'ID' => $post_id ) );	//content unchanged, shouldn't save
 		$this->assertCount( 5, wp_get_post_revisions( $post_id ) );
