diff --git tests/phpunit/tests/xmlrpc/wp/editPost.php tests/phpunit/tests/xmlrpc/wp/editPost.php
index 90399b092c..8251fa524a 100644
|
|
class Tests_XMLRPC_wp_editPost extends WP_XMLRPC_UnitTestCase { |
496 | 496 | $future_date_string = strftime( '%Y-%m-%d %H:%M:%S', $future_time ); |
497 | 497 | $this->assertEquals( $future_date_string, $after->post_date ); |
498 | 498 | } |
| 499 | |
| 500 | /** |
| 501 | * @ticket 45322 |
| 502 | */ |
| 503 | function test_draft_not_assigned_published_date() { |
| 504 | $editor_id = $this->make_user_by_role( 'editor' ); |
| 505 | |
| 506 | // Start with a draft post, confirming its post_date_gmt is "zero" |
| 507 | $post = array( |
| 508 | 'post_title' => 'Test', |
| 509 | 'post_status' => 'draft', |
| 510 | ); |
| 511 | $post_id = $this->myxmlrpcserver->wp_newPost( array( 1, 'editor', 'editor', $post ) ); |
| 512 | $before = get_post( $post_id ); |
| 513 | $this->assertEquals( '0000-00-00 00:00:00', $before->post_date_gmt ); |
| 514 | |
| 515 | // Edit the post without specifying any dates |
| 516 | $new_post_content = array( |
| 517 | 'ID' => $post_id, |
| 518 | 'post_title' => 'Updated', |
| 519 | ); |
| 520 | |
| 521 | $this->myxmlrpcserver->wp_editPost( array( 1, 'editor', 'editor', $post_id, $new_post_content ) ); |
| 522 | |
| 523 | // The published date should still be zero |
| 524 | $after = get_post( $post_id ); |
| 525 | $this->assertEquals( '0000-00-00 00:00:00', $after->post_date_gmt ); |
| 526 | } |
499 | 527 | } |