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:
Sergey Biryukov 2019-11-12 17:34:05 +00:00
parent eabc288f67
commit 6c776ea07b
12 changed files with 39 additions and 12 deletions

View File

@ -22,7 +22,7 @@ For more information about Twenty Eleven please go to https://codex.wordpress.or
== Copyright ==
Twenty Eleven WordPress Theme, Copyright 2011-2018 WordPress.org & Automattic.com
Twenty Eleven WordPress Theme, Copyright 2011-2019 WordPress.org & Automattic.com
Twenty Eleven is Distributed under the terms of the GNU GPL
This program is free software: you can redistribute it and/or modify

View File

@ -30,7 +30,7 @@ For more information about Twenty Fifteen please go to https://wordpress.org/sup
== Copyright ==
Twenty Fifteen WordPress Theme, Copyright 2014-2018 WordPress.org & Automattic.com
Twenty Fifteen WordPress Theme, Copyright 2014-2019 WordPress.org & Automattic.com
Twenty Fifteen is distributed under the terms of the GNU GPL
This program is free software: you can redistribute it and/or modify

View File

@ -22,7 +22,7 @@ For more information about Twenty Fourteen please go to https://codex.wordpress.
== Copyright ==
Twenty Fourteen WordPress Theme, Copyright 2013-2018 WordPress.org & Automattic.com
Twenty Fourteen WordPress Theme, Copyright 2013-2019 WordPress.org & Automattic.com
Twenty Fourteen is Distributed under the terms of the GNU GPL
This program is free software: you can redistribute it and/or modify

View File

@ -24,7 +24,7 @@ For more information about Twenty Nineteen please go to https://wordpress.org/su
== Copyright ==
Twenty Nineteen WordPress Theme, Copyright 2018 WordPress.org
Twenty Nineteen WordPress Theme, Copyright 2018-2019 WordPress.org
Twenty Nineteen is distributed under the terms of the GNU GPL
This program is free software: you can redistribute it and/or modify
@ -66,4 +66,4 @@ Initial release
== Resources ==
* normalize.css, © 2012-2018 Nicolas Gallagher and Jonathan Neal, MIT
* Underscores, © 2012-2018 Automattic, Inc., GNU GPL v2 or later
* Underscores, © 2012-2019 Automattic, Inc., GNU GPL v2 or later

View File

@ -16,7 +16,7 @@ Tags: one-column, flexible-header, accessibility-ready, custom-colors, custom-me
This theme, like WordPress, is licensed under the GPL.
Use it to make something cool, have fun, and share what you've learned with others.
Twenty Nineteen is based on Underscores https://underscores.me/, (C) 2012-2018 Automattic, Inc.
Twenty Nineteen is based on Underscores https://underscores.me/, (C) 2012-2019 Automattic, Inc.
Underscores is distributed under the terms of the GNU GPL v2 or later.
Normalizing styles have been helped along thanks to the fine work of

View File

@ -15,7 +15,7 @@ Tags: one-column, flexible-header, accessibility-ready, custom-colors, custom-me
This theme, like WordPress, is licensed under the GPL.
Use it to make something cool, have fun, and share what you've learned with others.
Twenty Nineteen is based on Underscores https://underscores.me/, (C) 2012-2018 Automattic, Inc.
Twenty Nineteen is based on Underscores https://underscores.me/, (C) 2012-2019 Automattic, Inc.
Underscores is distributed under the terms of the GNU GPL v2 or later.
Normalizing styles have been helped along thanks to the fine work of

View File

@ -14,7 +14,7 @@ Tags: one-column, flexible-header, accessibility-ready, custom-colors, custom-me
This theme, like WordPress, is licensed under the GPL.
Use it to make something cool, have fun, and share what you've learned with others.
Twenty Nineteen is based on Underscores https://underscores.me/, (C) 2012-2018 Automattic, Inc.
Twenty Nineteen is based on Underscores https://underscores.me/, (C) 2012-2019 Automattic, Inc.
Underscores is distributed under the terms of the GNU GPL v2 or later.
Normalizing styles have been helped along thanks to the fine work of

View File

@ -22,7 +22,7 @@ For more information about Twenty Seventeen please go to https://wordpress.org/s
== Copyright ==
Twenty Seventeen WordPress Theme, Copyright 2016 WordPress.org
Twenty Seventeen WordPress Theme, Copyright 2016-2019 WordPress.org
Twenty Seventeen is distributed under the terms of the GNU GPL
This program is free software: you can redistribute it and/or modify

View File

@ -28,7 +28,7 @@ For more information about Twenty Sixteen please go to https://wordpress.org/sup
== Copyright ==
Twenty Sixteen WordPress Theme, Copyright 2014-2018 WordPress.org
Twenty Sixteen WordPress Theme, Copyright 2014-2019 WordPress.org
Twenty Sixteen is distributed under the terms of the GNU GPL
This program is free software: you can redistribute it and/or modify

View File

@ -21,7 +21,7 @@ For more information about Twenty Ten theme please go to https://codex.wordpress
== Copyright ==
Twenty Ten WordPress Theme, Copyright 2010-2018 WordPress.org & Automattic.com
Twenty Ten WordPress Theme, Copyright 2010-2019 WordPress.org & Automattic.com
Twenty Ten is Distributed under the terms of the GNU GPL
This program is free software: you can redistribute it and/or modify

View File

@ -21,7 +21,7 @@ For more information about Twenty Thirteen please go to https://codex.wordpress.
== Copyright ==
Twenty Thirteen WordPress Theme, Copyright 2013-2018 WordPress.org & Automattic.com
Twenty Thirteen WordPress Theme, Copyright 2013-2019 WordPress.org & Automattic.com
Twenty Thirteen is Distributed under the terms of the GNU GPL
This program is free software: you can redistribute it and/or modify

View File

@ -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