You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 3722a58
Browse filesBrowse the repository at this point in the historyBrowse files
Tests: Use independent readme version fixtures and negative cases.
Address review feedback by stopping fixtures from echoing the recommendation under test, and cover unsupported or expired releases with fixed reference dates.
$this->assertStringContainsString( 'Recommended PHP version is too old', $e->getMessage() );
64
+
}
53
65
54
-
$this->assertContains( $matches[1], $php_matches[1], "readme.html's Recommended PHP version is too old. Remember to update the WordPress.org Requirements page, too." );
66
+
$this->assertTrue( $failed, 'Expected an unsupported PHP version to fail.' );
55
67
}
56
68
57
69
/**
@@ -67,42 +79,33 @@ public function test_readme_mysql_version() {
67
79
68
80
preg_match( '#Recommendations.*MySQL</a> version <strong>([0-9.]*)#s', $readme, $matches );
69
81
70
-
/*
71
-
* Per https://www.mysql.com/support/, Oracle actively supports MySQL releases for 5 years from GA release.
72
-
*
73
-
* The currently recommended MySQL 8.0 branch moved from active support to extended support on 2023-04-19.
74
-
* As WordPress core may not be fully compatible with MySQL 8.1 at this time, the "supported" period here
75
-
* is increased to 8 years to include extended support.
76
-
*
77
-
* TODO: Reduce this back to 5 years once MySQL 8.1 compatibility is achieved.
78
-
*
79
-
* Fixture EOL is one year ago so the +8 year support window still includes today.
$this->assertStringContainsString( 'Recommended MySQL version is too old', $e->getMessage() );
106
+
}
104
107
105
-
$this->assertLessThan( $mysql_eol, $current_date, "readme.html's Recommended MySQL version is too old. Remember to update the WordPress.org Requirements page, too." );
108
+
$this->assertTrue( $failed, 'Expected an expired MySQL support window to fail.' );
106
109
}
107
110
108
111
/**
@@ -118,36 +121,173 @@ public function test_readme_mariadb_version() {
118
121
119
122
preg_match( '#Recommendations.*MariaDB</a> version <strong>([0-9.]*)#s', $readme, $matches );
$this->assertContains( $recommended, $php_matches[1], "readme.html's Recommended PHP version is too old. Remember to update the WordPress.org Requirements page, too." );
245
+
}
246
+
247
+
/**
248
+
* Asserts a recommended MySQL version is still within the extended support window.
249
+
*
250
+
* @param string $recommended Recommended MySQL version from readme.html.
$this->assertLessThan( $mysql_eol, $reference_date, "readme.html's Recommended MySQL version is too old. Remember to update the WordPress.org Requirements page, too." );
270
+
}
271
+
272
+
/**
273
+
* Asserts a recommended MariaDB version is listed and not past its EOL date.
274
+
*
275
+
* @param string $recommended Recommended MariaDB version from readme.html.
// If the release ID is not found the version is unsupported.
144
286
if ( ! isset( $mariadb_eol ) ) {
145
-
$this->fail( "{$matches[1]} is not included in MariaDB's list of supported versions. Remember to update the WordPress.org Requirements page, too." );
287
+
$this->fail( "{$recommended} is not included in MariaDB's list of supported versions. Remember to update the WordPress.org Requirements page, too." );
146
288
}
147
289
148
-
$current_date = gmdate( 'Y-m-d' );
149
-
150
-
$this->assertLessThan( $mariadb_eol, $current_date, "readme.html's Recommended MariaDB version is too old. Remember to update the WordPress.org Requirements page, too." );
290
+
$this->assertLessThan( $mariadb_eol, $reference_date, "readme.html's Recommended MariaDB version is too old. Remember to update the WordPress.org Requirements page, too." );
0 commit comments