Make WordPress Core

Changeset 1027 in tests


Ignore:
Timestamp:
09/20/2012 07:52:16 AM (13 years ago)
Author:
westi
Message:

Posts: Improve the tests for invalid dates to test both return paths and make sure that we only return a WP_Error when requested to do so. See #WP17180

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/post.php

    r1026 r1027  
    358358        );
    359359
    360         $insert_post = wp_insert_post( $post );
     360        // Test both return paths with or without WP_Error
     361        $insert_post = wp_insert_post( $post, true );
    361362        $this->assertTrue( is_wp_error( $insert_post ), 'Did not get a WP_Error back from wp_insert_post' );
    362363        $this->assertEquals( 'invalid_date', $insert_post->get_error_code() );
    363364
     365        $insert_post = wp_insert_post( $post );
     366        $this->assertEquals( 0, $insert_post );
    364367    }
    365368
Note: See TracChangeset for help on using the changeset viewer.