| 346 | /** |
| 347 | * @ticket 17180 |
| 348 | */ |
| 349 | function test_vb_insert_invalid_date() { |
| 350 | // insert a post with an invalid date, make sure it fails |
| 351 | |
| 352 | $post = array( |
| 353 | 'post_author' => $this->author_id, |
| 354 | 'post_status' => 'public', |
| 355 | 'post_content' => rand_str(), |
| 356 | 'post_title' => rand_str(), |
| 357 | 'post_date' => '2012-02-30 00:00:00', |
| 358 | ); |
| 359 | |
| 360 | $insert_post = wp_insert_post( $post ); |
| 361 | $this->assertTrue( is_wp_error( $insert_post ) ); |
| 362 | $this->assertEquals( 'invalid_date', $insert_post->get_error_code() ); |
| 363 | |
| 364 | } |
| 365 | |