@@ -206,15 +206,15 @@ public function test_update_post_preserves_date_for_future_posts( $initial_statu
206206
207207 $ future_date = gmdate ( 'Y-m-d H:i:s ' , strtotime ( $ time_offset ) );
208208 $ update_data = array (
209- 'ID ' => $ post_id ,
210- 'post_status ' => 'future ' ,
211- 'post_date ' => $ future_date ,
209+ 'ID ' => $ post_id ,
210+ 'post_status ' => 'future ' ,
211+ 'post_date_gmt ' => $ future_date ,
212212 );
213213
214214 wp_update_post ( $ update_data );
215215 $ updated_post = get_post ( $ post_id );
216216
217- $ this ->assertSame ( $ future_date , $ updated_post ->post_date , 'Post date should be preserved when updating to future status . ' );
217+ $ this ->assertSame ( $ future_date , $ updated_post ->post_date_gmt , 'Post date should be updated accordingly . ' );
218218 $ this ->assertSame ( $ expected_status , $ updated_post ->post_status , "Post status should be ' {$ expected_status }' after update. " );
219219 }
220220
@@ -238,7 +238,7 @@ public function data_update_post_preserves_date_for_future_posts() {
238238 'publish to future with 1 day more ' => array (
239239 'initial_status ' => 'publish ' ,
240240 'time_offset ' => '+1 day ' ,
241- 'expected_status ' => 'publish ' ,
241+ 'expected_status ' => 'future ' ,
242242 ),
243243 'draft to future with 1 day less ' => array (
244244 'initial_status ' => 'draft ' ,
0 commit comments