Make WordPress Core

Ticket #30429: 30429.test.patch

File 30429.test.patch, 991 bytes (added by justdaiv, 11 years ago)

Unit test

  • newPost.php

     
    383383                $this->assertEquals( $date_string , $fetched_post->post_date_gmt );
    384384        }
    385385
     386        /**
     387         * @ticket 30429
     388         */
     389        function test_post_date_timezone_conversion() {
     390                update_option( 'timezone_string', 'America/New_York' );  //any non GMT
     391                $this->make_user_by_role( 'author' );
     392                $date_string = '1984-01-11 05:00:00';
     393                $post = array( 'post_title' => 'test', 'post_content' => 'test', 'post_date' => $date_string );
     394                $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'author', 'author', $post ) );
     395                $fetched_post = get_post( $result );
     396                $this->assertStringMatchesFormat( '%d', $result );
     397                $this->assertEquals( $date_string , $fetched_post->post_date );
     398        }
     399
    386400}