Make WordPress Core

Changeset 46981


Ignore:
Timestamp:
12/17/2019 09:31:08 PM (4 years ago)
Author:
SergeyBiryukov
Message:

Tests: Use delta comparison in test_should_fall_back_to_last_post_modified() to avoid race conditions.

See #48957.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/date/getFeedBuildDate.php

    r46974 r46981  
    6262
    6363        $this->assertEquals(
    64             $datetime_utc->format( DATE_RFC3339 ),
    65             get_feed_build_date( DATE_RFC3339 ),
    66             'Fall back to time of last post modified with no posts'
     64            strtotime( $datetime_utc->format( DATE_RFC3339 ) ),
     65            strtotime( get_feed_build_date( DATE_RFC3339 ) ),
     66            'Fall back to time of last post modified with no posts',
     67            2
    6768        );
    6869
     
    7576
    7677        $this->assertEquals(
    77             $datetime_utc->format( DATE_RFC3339 ),
    78             get_feed_build_date( DATE_RFC3339 ),
    79             'Fall back to time of last post modified with broken post object'
     78            strtotime( $datetime_utc->format( DATE_RFC3339 ) ),
     79            strtotime( get_feed_build_date( DATE_RFC3339 ) ),
     80            'Fall back to time of last post modified with broken post object',
     81            2
    8082        );
    8183    }
Note: See TracChangeset for help on using the changeset viewer.