mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-03-31 10:44:26 +00:00
XMLRPC: Restore support in wp.newPost for dates to be supplied in the structured dateTime.iso8601 format as well as still supporting dates specified as strings.
Fixes #28601. git-svn-id: https://develop.svn.wordpress.org/trunk@29063 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -357,4 +357,30 @@ class Tests_XMLRPC_wp_newPost extends WP_XMLRPC_UnitTestCase {
|
||||
$this->assertEquals( $date_string , $fetched_post->post_date_gmt );
|
||||
}
|
||||
|
||||
/**
|
||||
* @ticket 28601
|
||||
*/
|
||||
function test_valid_IXR_post_date() {
|
||||
$this->make_user_by_role( 'author' );
|
||||
$date_string = '1984-01-11 05:00:00';
|
||||
$post = array( 'post_title' => 'test', 'post_content' => 'test', 'post_date' => new IXR_Date( mysql2date( 'Ymd\TH:i:s', $date_string, false ) ) );
|
||||
$result = $this->myxmlrpcserver->wp_newPost( array( 1, 'author', 'author', $post ) );
|
||||
$fetched_post = get_post( $result );
|
||||
$this->assertStringMatchesFormat( '%d', $result );
|
||||
$this->assertEquals( $date_string , $fetched_post->post_date );
|
||||
}
|
||||
|
||||
/**
|
||||
* @ticket 28601
|
||||
*/
|
||||
function test_valid_IXR_post_date_gmt() {
|
||||
$this->make_user_by_role( 'author' );
|
||||
$date_string = '1984-01-11 05:00:00';
|
||||
$post = array( 'post_title' => 'test', 'post_content' => 'test', 'post_date_gmt' => new IXR_Date( mysql2date( 'Ymd\TH:i:s', $date_string, false ) ) );
|
||||
$result = $this->myxmlrpcserver->wp_newPost( array( 1, 'author', 'author', $post ) );
|
||||
$fetched_post = get_post( $result );
|
||||
$this->assertStringMatchesFormat( '%d', $result );
|
||||
$this->assertEquals( $date_string , $fetched_post->post_date_gmt );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user