Make WordPress Core


Ignore:
Timestamp:
05/23/2022 02:07:47 PM (2 years ago)
Author:
SergeyBiryukov
Message:

Tests: Improve the assertions in recommended MySQL and MariaDB version tests.

Comparing human-readable dates instead of numeric timestamps gives identical results, but makes the message more clear in case of failure.

Follow-up to [33946], [52418], [52421], [52424].

See #55791, #55652.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/external-http/basic.php

    r53431 r53433  
    5353         * TODO: Reduce this back to 5 years once MySQL 8.0 compatibility is achieved.
    5454         */
    55         $mysql_eol = strtotime( $mysql_matches[1] . ' +8 years' );
     55        $mysql_eol    = gmdate( 'Y-m-d', strtotime( $mysql_matches[1] . ' +8 years' ) );
     56        $current_date = gmdate( 'Y-m-d' );
    5657
    57         $this->assertLessThan( $mysql_eol, time(), "readme.html's Recommended MySQL version is too old. Remember to update the WordPress.org Requirements page, too." );
     58        $this->assertLessThan( $mysql_eol, $current_date, "readme.html's Recommended MySQL version is too old. Remember to update the WordPress.org Requirements page, too." );
    5859    }
    5960
     
    8586
    8687        // Per https://mariadb.org/about/#maintenance-policy, MariaDB releases are supported for 5 years.
    87         $mariadb_eol = strtotime( $mariadb_matches[1] . ' +5 years' );
     88        $mariadb_eol  = gmdate( 'Y-m-d', strtotime( $mariadb_matches[1] . ' +5 years' ) );
     89        $current_date = gmdate( 'Y-m-d' );
    8890
    89         $this->assertLessThan( $mariadb_eol, time(), "readme.html's Recommended MariaDB version is too old. Remember to update the WordPress.org Requirements page, too." );
     91        $this->assertLessThan( $mariadb_eol, $current_date, "readme.html's Recommended MariaDB version is too old. Remember to update the WordPress.org Requirements page, too." );
    9092    }
    9193
Note: See TracChangeset for help on using the changeset viewer.