| 8 | function test_invalid_post_date_does_not_fatal() { |
| 9 | $this->make_user_by_role( 'author' ); |
| 10 | $date_string = '2014-01-01 10:10:10'; |
| 11 | $post = array( 'post_title' => 'test', 'post_content' => 'test', 'post_date' => $date_string ); |
| 12 | $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'author', 'author', $post ) ); |
| 13 | $fetched_post = get_post( $result ); |
| 14 | $this->assertStringMatchesFormat( '%d', $result ); |
| 15 | } |
| 16 | |
| 17 | function test_invalid_post_date_gmt_does_not_fatal() { |
| 18 | $this->make_user_by_role( 'author' ); |
| 19 | $date_string = 'invalid date'; |
| 20 | $post = array( 'post_title' => 'test', 'post_content' => 'test', 'post_date_gmt' => $date_string ); |
| 21 | $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'author', 'author', $post ) ); |
| 22 | $fetched_post = get_post( $result ); |
| 23 | $this->assertStringMatchesFormat( '%d', $result ); |
| 24 | } |
| 25 | |