Make WordPress Core

Changeset 39065


Ignore:
Timestamp:
11/01/2016 03:13:27 AM (8 years ago)
Author:
dd32
Message:

Themes: Update the unit tests to handle [39064] and #31550.

test_default_theme_in_default_theme_list() was always being skipped after #31550, this causes it to once again check that the unit tests are up to date and include the latest default theme.
test_default_themes_have_textdomain() didn't play happy when a default theme wasn't installed on a site.

See #31550, #29925, #38551.

File:
1 edited

Legend:

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

    r39064 r39065  
    1111    protected $default_themes = array(
    1212        'twentyten', 'twentyeleven', 'twentytwelve', 'twentythirteen',
    13         'twentyfourteen', 'twentyfifteen',
     13        'twentyfourteen', 'twentyfifteen', 'twentysixteen', 'twentyseventeen',
    1414    );
    1515
     
    188188     */
    189189    function test_default_theme_in_default_theme_list() {
    190         if ( 'twenty' === substr( WP_DEFAULT_THEME, 0, 6 ) ) {
    191             $this->assertContains( WP_DEFAULT_THEME, $this->default_themes );
    192         }
     190        $latest_default_theme = WP_Theme::get_core_default_theme();
     191        if ( ! $latest_default_theme->exists() || 'twenty' !== substr( $latest_default_theme->get_stylesheet(), 0, 6 ) ) {
     192            $this->markTestSkipped( 'No Twenty* series default themes are installed' );
     193        }
     194        $this->assertContains( $latest_default_theme->get_stylesheet(), $this->default_themes );
    193195    }
    194196
    195197    function test_default_themes_have_textdomain() {
    196198        foreach ( $this->default_themes as $theme ) {
    197             $this->assertEquals( $theme, wp_get_theme( $theme )->get( 'TextDomain' ) );
     199            if ( wp_get_theme( $theme )->exists() ) {
     200                $this->assertEquals( $theme, wp_get_theme( $theme )->get( 'TextDomain' ) );
     201            }
    198202        }
    199203    }
Note: See TracChangeset for help on using the changeset viewer.