mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
Tests: Improve the logic of the SECURITY.md test to check all supported versions.
This avoids a test failure if the list of supported WordPress versions is updated before the trunk version is bumped for a new major release. Follow-up to [47403], [53347]. Fixes #55667. git-svn-id: https://develop.svn.wordpress.org/trunk@53357 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -221,17 +221,22 @@ class Tests_Theme extends WP_UnitTestCase {
|
||||
|
||||
$path_to_readme_txt = $wp_theme->get_theme_root() . '/' . $wp_theme->get_stylesheet() . '/readme.txt';
|
||||
$this->assertFileExists( $path_to_readme_txt );
|
||||
|
||||
$readme = file_get_contents( $path_to_readme_txt );
|
||||
$this_year = gmdate( 'Y' );
|
||||
|
||||
preg_match( '#Copyright (\d+) WordPress.org#', $readme, $matches );
|
||||
if ( $matches ) {
|
||||
$this->assertSame( $this_year, trim( $matches[1] ), "Bundled themes readme.txt's year needs to be updated to $this_year." );
|
||||
$readme_year = trim( $matches[1] );
|
||||
|
||||
$this->assertSame( $this_year, $readme_year, "Bundled themes readme.txt's year needs to be updated to $this_year." );
|
||||
}
|
||||
|
||||
preg_match( '#Copyright 20\d\d-(\d+) WordPress.org#', $readme, $matches );
|
||||
if ( $matches ) {
|
||||
$this->assertSame( $this_year, trim( $matches[1] ), "Bundled themes readme.txt's year needs to be updated to $this_year." );
|
||||
$readme_year = trim( $matches[1] );
|
||||
|
||||
$this->assertSame( $this_year, $readme_year, "Bundled themes readme.txt's year needs to be updated to $this_year." );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user