Tests: Avoid a race condition in test_date_i18n_handles_shorthand_formats() by using a delta for comparing timestamps.

See #20973, #38381.

git-svn-id: https://develop.svn.wordpress.org/trunk@43562 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2018-08-11 13:28:26 +00:00
parent 28a6760634
commit 3b4b754f2a

View File

@ -89,7 +89,7 @@ class Tests_Date_I18n extends WP_UnitTestCase {
* @ticket 20973
*/
public function test_date_i18n_handles_shorthand_formats( $short, $full ) {
$this->assertEquals( date_i18n( $full ), date_i18n( $short ) );
$this->assertEquals( strtotime( date_i18n( $full ) ), strtotime( date_i18n( $short ) ), 'The dates should be equal', 2 );
$this->assertEquals( $short, date_i18n( '\\' . $short ) );
}