diff --git tests/phpunit/tests/post.php tests/phpunit/tests/post.php
index 4f5a294..636b82b 100644
|
|
class Tests_Post extends WP_UnitTestCase { |
1258 | 1258 | $this->assertEquals( 0, get_post( $page_id )->post_parent ); |
1259 | 1259 | } |
1260 | 1260 | |
| 1261 | /** |
| 1262 | * @ticket 35874 |
| 1263 | */ |
| 1264 | function test_wp_update_post_should_respect_post_date() { |
| 1265 | $post = array( |
| 1266 | 'post_author' => self::$editor_id, |
| 1267 | 'post_status' => 'draft', |
| 1268 | 'post_content' => rand_str(), |
| 1269 | 'post_title' => rand_str(), |
| 1270 | ); |
| 1271 | |
| 1272 | $id = wp_insert_post($post); |
| 1273 | |
| 1274 | $out = get_post($id); |
| 1275 | |
| 1276 | // Change the post status to publish while also supplying a date |
| 1277 | $specific_date = strftime("%Y-%m-%d %H:%M:%S", strtotime('+1 day')); |
| 1278 | |
| 1279 | $post['ID'] = $id; |
| 1280 | $post['post_date'] = $specific_date; |
| 1281 | $post['post_status'] = 'publish'; |
| 1282 | wp_update_post( $post ); |
| 1283 | |
| 1284 | // Updated post should still possess the specified date |
| 1285 | $out = get_post($id); |
| 1286 | $this->assertEquals($specific_date, $out->post_date); |
| 1287 | } |
| 1288 | |
1261 | 1289 | } |