Date/Time: Update XML-RPC tests for invalid date input to account for a more consistent `mysql2date()` error handling in [45908].

The tests were meant to check for the lack of a fatal error in case of invalid date input, not specifically mark a particular outcome as the correct one.

Props Rarst.
Fixes #28992.

git-svn-id: https://develop.svn.wordpress.org/trunk@45911 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2019-08-29 16:43:28 +00:00
parent 4572bb0988
commit 355d93d977
1 changed files with 3 additions and 3 deletions

View File

@ -355,7 +355,7 @@ class Tests_XMLRPC_wp_newPost extends WP_XMLRPC_UnitTestCase {
$result = $this->myxmlrpcserver->wp_newPost( array( 1, 'author', 'author', $post ) );
$fetched_post = get_post( $result );
$this->assertStringMatchesFormat( '%d', $result );
$this->assertEquals( '1970-01-01 00:00:00', $fetched_post->post_date );
$this->assertEquals( current_time( 'Y-m-d' ), substr( $fetched_post->post_date, 0, 10 ) );
}
/**
@ -363,7 +363,7 @@ class Tests_XMLRPC_wp_newPost extends WP_XMLRPC_UnitTestCase {
*/
function test_invalid_post_date_gmt_does_not_fatal() {
$this->make_user_by_role( 'author' );
$date_string = 'invalid date';
$date_string = 'invalid_date';
$post = array(
'post_title' => 'test',
'post_content' => 'test',
@ -372,7 +372,7 @@ class Tests_XMLRPC_wp_newPost extends WP_XMLRPC_UnitTestCase {
$result = $this->myxmlrpcserver->wp_newPost( array( 1, 'author', 'author', $post ) );
$fetched_post = get_post( $result );
$this->assertStringMatchesFormat( '%d', $result );
$this->assertEquals( '1970-01-01 00:00:00', $fetched_post->post_date_gmt );
$this->assertEquals( '0000-00-00', substr( $fetched_post->post_date_gmt, 0, 10 ) );
}
/**