mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
Bundled Themes: Update copyright year in readme.txt.
Add a unit test to ensure the year stays up to date. Props dkarfa, SergeyBiryukov. Fixes #48566. git-svn-id: https://develop.svn.wordpress.org/trunk@46719 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -210,6 +210,33 @@ class Tests_Theme extends WP_UnitTestCase {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @ticket 48566
|
||||
*/
|
||||
function test_year_in_readme() {
|
||||
// This test is designed to only run on trunk/master.
|
||||
$this->skipOnAutomatedBranches();
|
||||
|
||||
foreach ( $this->default_themes as $theme ) {
|
||||
$wp_theme = wp_get_theme( $theme );
|
||||
|
||||
$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->assertEquals( $this_year, trim( $matches[1] ), "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->assertEquals( $this_year, trim( $matches[1] ), "Bundled themes readme.txt's year needs to be updated to $this_year." );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @ticket 20897
|
||||
* @expectedDeprecated get_theme_data
|
||||
|
||||
Reference in New Issue
Block a user