Changeset 54069 for trunk/tests/phpunit/tests/site-health.php
- Timestamp:
- 09/05/2022 03:18:13 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/site-health.php
r54053 r54069 10 10 // Include the `WP_Site_Health` file. 11 11 require_once ABSPATH . 'wp-admin/includes/class-wp-site-health.php'; 12 } 13 14 /** 15 * @ticket 55791 16 * @covers ::prepare_sql_data() 17 * @covers ::get_test_sql_server() 18 */ 19 public function test_mysql_recommended_version_matches_readme_html() { 20 // This test is designed to only run on trunk. 21 $this->skipOnAutomatedBranches(); 22 23 $wp_site_health = new WP_Site_Health(); 24 $wp_site_health->get_test_sql_server(); 25 26 $reflection = new ReflectionClass( $wp_site_health ); 27 $reflection_property = $reflection->getProperty( 'mysql_recommended_version' ); 28 $reflection_property->setAccessible( true ); 29 30 $readme = file_get_contents( ABSPATH . 'readme.html' ); 31 32 preg_match( '#Recommendations.*MySQL</a> version <strong>([0-9.]*)#s', $readme, $matches ); 33 34 $this->assertSame( $matches[1], $reflection_property->getValue( $wp_site_health ) ); 35 } 36 37 /** 38 * @ticket 55791 39 * @covers ::prepare_sql_data() 40 * @covers ::get_test_sql_server() 41 */ 42 public function test_mariadb_recommended_version_matches_readme_html() { 43 // This test is designed to only run on trunk. 44 $this->skipOnAutomatedBranches(); 45 46 $wp_site_health = new WP_Site_Health(); 47 $wp_site_health->get_test_sql_server(); 48 49 $reflection = new ReflectionClass( $wp_site_health ); 50 $reflection_property = $reflection->getProperty( 'mariadb_recommended_version' ); 51 $reflection_property->setAccessible( true ); 52 53 $readme = file_get_contents( ABSPATH . 'readme.html' ); 54 55 preg_match( '#Recommendations.*MariaDB</a> version <strong>([0-9.]*)#s', $readme, $matches ); 56 57 $this->assertSame( $matches[1], $reflection_property->getValue( $wp_site_health ) ); 12 58 } 13 59
Note: See TracChangeset
for help on using the changeset viewer.