From 230313d25a7f51ed93aa4024e201ac60238c4b9c Mon Sep 17 00:00:00 2001 From: Aaron Jorbin Date: Fri, 17 Oct 2014 20:59:23 +0000 Subject: [PATCH] Check if WP_DEFAULT_THEME starts with twenty before asserting it is in default theme array This fixes an issue that if you change WP_DEFAULT_THEME and run core unit tests, the tests fail since your theme isn't one of the hard coded lists of default themes. We need to keep this test to make sure that we update the array of default themes for use in other tests. If we ever change the naming convention for default themes, this will need to be updated. props nacin for initial idea fixes #29925 git-svn-id: https://develop.svn.wordpress.org/trunk@29946 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/theme.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/phpunit/tests/theme.php b/tests/phpunit/tests/theme.php index 5dcaee8bac..7c85478e41 100644 --- a/tests/phpunit/tests/theme.php +++ b/tests/phpunit/tests/theme.php @@ -165,8 +165,17 @@ class Tests_Theme extends WP_UnitTestCase { $this->assertEquals( content_url( 'themes/' . $this->theme_slug ), $theme->get_template_directory_uri(), 'get_template_directory_uri' ); } + /** + * Make sure we update the default theme list to include the lastest default theme + * @ticket 29925 + */ + function test_default_theme_in_default_theme_list(){ + if ( substr(WP_DEFAULT_THEME, 0, 6) === 'twenty') { + $this->assertContains( WP_DEFAULT_THEME, $this->default_themes ); + } + } + function test_default_themes_have_textdomain() { - $this->assertContains( WP_DEFAULT_THEME, $this->default_themes ); foreach ( $this->default_themes as $theme ) { $this->assertEquals( $theme, wp_get_theme( $theme )->get( 'TextDomain' ) ); }