Make WordPress Core


Ignore:
Timestamp:
01/03/2016 07:49:34 PM (9 years ago)
Author:
nacin
Message:

XML-RPC: Revert [34681] as it broke date handling.

Merges [36163] to the 4.4 branch.

props dossy, hnle, redsweater.
see #35053, #30429 (original ticket).

Location:
branches/4.4
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.4

  • branches/4.4/tests/phpunit/tests/xmlrpc/wp/editComment.php

    r35242 r36164  
    7070        $this->assertEquals( 'trash', get_comment( $comment_id )->comment_approved );
    7171    }
    72 
    73     /**
    74      * @ticket 30429
    75      */
    76     function test_post_date_timezone_conversion() {
    77         $tz = get_option( 'timezone_string' );
    78         update_option( 'timezone_string', 'America/New_York' );
    79 
    80         $this->make_user_by_role( 'administrator' );
    81         $post_id = self::factory()->post->create();
    82 
    83         $comment_data = array(
    84             'comment_post_ID' => $post_id,
    85             'comment_author' => 'Test commenter',
    86             'comment_author_url' => 'http://example.com/',
    87             'comment_author_email' => 'example@example.com',
    88             'comment_content' => rand_str( 100 ),
    89             'comment_approved' => '1',
    90         );
    91         $comment_id = wp_insert_comment( $comment_data );
    92 
    93         $date_string = '1984-01-11 05:00:00';
    94         $result = $this->myxmlrpcserver->wp_editComment( array( 1, 'administrator', 'administrator', $comment_id, array(
    95             'date_created_gmt' => new IXR_Date( mysql2date( 'Ymd\TH:i:s', $date_string, false ) )
    96         ) ) );
    97         $fetched_comment = get_comment( $comment_id );
    98 
    99         update_option( 'timezone_string', $tz );
    100 
    101         $this->assertTrue( $result );
    102         $this->assertEquals( $date_string, $fetched_comment->comment_date );
    103     }
    10472}
Note: See TracChangeset for help on using the changeset viewer.