Make WordPress Core

Changeset 54076


Ignore:
Timestamp:
09/06/2022 12:11:20 AM (21 months ago)
Author:
SergeyBiryukov
Message:

Tests: Correct the tests for Site Health SQL versions matching readme.html.

These tests should check the initial $mysql_recommended_version and $mariadb_recommended_version properties, as WP_Site_Health::prepare_sql_data() redefines the former with the latter to simplify further processing if MariaDB is used, leading to a test failure:

Tests_Site_Health::test_mysql_recommended_version_matches_readme_html
Failed asserting that two strings are identical.
--- Expected
+++ Actual
@@ @@
-'5.7'
+'10.3'

This commit uses the initial property values to ensure the correct versions are being compared.

Follow-up to [54069].

See #55791.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/admin/wpSiteHealth.php

    r54075 r54076  
    3535    /**
    3636     * @ticket 55791
    37      * @covers ::prepare_sql_data()
    38      * @covers ::get_test_sql_server()
     37     * @covers ::__construct()
    3938     */
    4039    public function test_mysql_recommended_version_matches_readme_html() {
     
    4241        $this->skipOnAutomatedBranches();
    4342
    44         $this->instance->get_test_sql_server();
    45 
    4643        $reflection          = new ReflectionClass( $this->instance );
    4744        $reflection_property = $reflection->getProperty( 'mysql_recommended_version' );
     
    5754    /**
    5855     * @ticket 55791
    59      * @covers ::prepare_sql_data()
    60      * @covers ::get_test_sql_server()
     56     * @covers ::__construct()
    6157     */
    6258    public function test_mariadb_recommended_version_matches_readme_html() {
    6359        // This test is designed to only run on trunk.
    6460        $this->skipOnAutomatedBranches();
    65 
    66         $this->instance->get_test_sql_server();
    6761
    6862        $reflection          = new ReflectionClass( $this->instance );
Note: See TracChangeset for help on using the changeset viewer.