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
This commit is contained in:
Aaron Jorbin 2014-10-17 20:59:23 +00:00
parent c2bea27bfd
commit 230313d25a
1 changed files with 10 additions and 1 deletions

View File

@ -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' ) );
}