Make WordPress Core

Ticket #38815: 38815.patch

File 38815.patch, 1017 bytes (added by keesiemeijer, 9 years ago)

Add a delta for comparing timestamps

  • tests/phpunit/tests/formatting/date.php

     
    8080         */
    8181        function test_get_gmt_from_date_string_date() {
    8282                update_option( 'timezone_string', 'Europe/London' );
    83                 $local = 'now';
    84                 $gmt = gmdate( 'Y-m-d H:i:s', strtotime( 'now' ) );
    85                 $this->assertEquals( $gmt, get_gmt_from_date( $local ) );
     83                $this->assertEquals( strtotime( gmdate( 'Y-m-d H:i:s' ) ), strtotime( get_gmt_from_date( 'now' ) ), 'The dates should be equal', 2 );
    8684        }
    8785
    8886        /**
    8987         * @ticket 34279
    9088         */
    9189        function test_get_gmt_from_date_string_date_no_timezone() {
    92                 $local = 'now';
    93                 $gmt = gmdate( 'Y-m-d H:i:s', strtotime( 'now' ) );
    94                 $this->assertEquals( $gmt, get_gmt_from_date( $local ) );
     90                $this->assertEquals( strtotime( gmdate( 'Y-m-d H:i:s' ) ), strtotime( get_gmt_from_date( 'now' ) ), 'The dates should be equal', 2 );
    9591        }
    9692}