Make WordPress Core

Changeset 29946


Ignore:
Timestamp:
10/17/2014 08:59:23 PM (9 years ago)
Author:
jorbin
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/theme.php

    r29895 r29946  
    166166    }
    167167
     168    /**
     169     * Make sure we update the default theme list to include the lastest default theme
     170     * @ticket 29925
     171     */
     172    function test_default_theme_in_default_theme_list(){
     173        if ( substr(WP_DEFAULT_THEME, 0, 6) === 'twenty') {
     174            $this->assertContains( WP_DEFAULT_THEME, $this->default_themes );
     175        }
     176    }
     177
    168178    function test_default_themes_have_textdomain() {
    169         $this->assertContains( WP_DEFAULT_THEME, $this->default_themes );
    170179        foreach ( $this->default_themes as $theme ) {
    171180            $this->assertEquals( $theme, wp_get_theme( $theme )->get( 'TextDomain' ) );
Note: See TracChangeset for help on using the changeset viewer.