Index: tests/phpunit/tests/query/postStatus.php
===================================================================
--- tests/phpunit/tests/query/postStatus.php	(revision 31106)
+++ tests/phpunit/tests/query/postStatus.php	(working copy)
@@ -195,8 +195,7 @@
 		$q = new WP_Query( array(
 			'posts_per_page' => -1,
 		) );
-global $wpdb;
-//print_r( $wpdb->get_results( "SELECT * FROM $wpdb->posts" ) );
+
 		$this->assertContains( self::$author_privatefoo_post, wp_list_pluck( $q->posts, 'ID' ) );
 		$this->assertContains( self::$editor_privatefoo_post, wp_list_pluck( $q->posts, 'ID' ) );
 	}
@@ -299,4 +298,56 @@
 
 		$this->assertEmpty( $q->posts );
 	}
+
+	public function test_post_permalink_not_rewritten_on_future_post() {
+		update_option('permalink_structure','/%year%/%monthnum%/%day%/%postname%/');
+		$post = array(
+			'post_author'  => self::$author_user,
+			'post_status'  => 'publish',
+			'post_content' => rand_str(),
+			'post_title'   => 'Future Test Post',
+			'post_date'    => strftime("%Y-%m-%d %H:%M:%S", strtotime('+1 day'))
+		);
+		
+		$post['ID'] = $this->factory->post->create($post);
+
+		$future_permalink     = get_permalink($post['ID']);
+
+		$post['post_date'] = strftime("%Y-%m-%d %H:%M:%S", strtotime('-1 day'));
+
+		wp_publish_post($post['ID']);
+		
+		$publish_permalink = get_permalink($post['ID']);
+		
+		$this->assertNotEquals($future_permalink, $publish_permalink);
+		return;
+	}
+
+
+	public function test_custom_post_type_permalink_not_rewritten_on_future_post() {
+		update_option('permalink_structure','/%year%/%monthnum%/%day%/%postname%/');
+		$post = array(
+			'post_author'  => self::$author_user,
+			'post_status'  => 'publish',
+			'post_content' => rand_str(),
+			'post_title'   => 'Future Test Post',
+			'post_date'    => strftime("%Y-%m-%d %H:%M:%S", strtotime('+1 day'))
+		);
+		
+		$post['ID'] = $this->factory->post->create($post);
+		
+		$future_permalink = get_permalink($post['ID']);
+
+		$post['post_date'] = strftime("%Y-%m-%d %H:%M:%S", strtotime('-1 day'));
+		
+		wp_publish_post($post['ID']);
+		
+		$publish_permalink = get_post_permalink($post['ID']);
+		
+		$this->assertNotEquals($future_permalink, $publish_permalink);
+		return;
+	}
 }
+
+
+		//http://wordpress.dev/?post_type=post&p=7
