Make WordPress Core

Changeset 46982


Ignore:
Timestamp:
12/17/2019 09:33:23 PM (5 years ago)
Author:
SergeyBiryukov
Message:

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

Merges [46981] to the 5.3 branch.
See #48957.

Location:
branches/5.3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/5.3

  • branches/5.3/tests/phpunit/tests/date/getFeedBuildDate.php

    r46977 r46982  
    6161
    6262        $this->assertEquals(
    63             $datetime_utc->format( DATE_RFC3339 ),
    64             get_feed_build_date( DATE_RFC3339 ),
    65             'Fall back to time of last post modified with no posts'
     63            strtotime( $datetime_utc->format( DATE_RFC3339 ) ),
     64            strtotime( get_feed_build_date( DATE_RFC3339 ) ),
     65            'Fall back to time of last post modified with no posts',
     66            2
    6667        );
    6768
     
    7475
    7576        $this->assertEquals(
    76             $datetime_utc->format( DATE_RFC3339 ),
    77             get_feed_build_date( DATE_RFC3339 ),
    78             'Fall back to time of last post modified with broken post object'
     77            strtotime( $datetime_utc->format( DATE_RFC3339 ) ),
     78            strtotime( get_feed_build_date( DATE_RFC3339 ) ),
     79            'Fall back to time of last post modified with broken post object',
     80            2
    7981        );
    8082    }
Note: See TracChangeset for help on using the changeset viewer.