WordPress.org

Make WordPress Core

Changeset 46969


Ignore:
Timestamp:
12/17/2019 02:35:25 PM (6 months ago)
Author:
SergeyBiryukov
Message:

Date/Time: Add a unit test for [46968].

See #48145.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/post.php

    r46819 r46969  
    596596
    597597    /**
     598     * @ticket 48145
     599     */
     600    function test_wp_insert_post_should_default_to_publish_if_post_date_is_within_59_seconds_from_current_time() {
     601        $future_date = gmdate( 'Y-m-d H:i:s', time() + 59 );
     602        $post_id     = self::factory()->post->create(
     603            array(
     604                'post_date' => $future_date,
     605            )
     606        );
     607
     608        $post = get_post( $post_id );
     609        $this->assertEquals( 'publish', $post->post_status );
     610        $this->assertEquals( $future_date, $post->post_date );
     611    }
     612
     613    /**
    598614     * @ticket 22944
    599615     */
Note: See TracChangeset for help on using the changeset viewer.