Make WordPress Core


Ignore:
Timestamp:
03/26/2014 06:21:45 PM (11 years ago)
Author:
nacin
Message:

WP_Theme: Return false from the display() method when get() fails.

Fixes a potential warning on the themes page when the active theme is deleted.

fixes #26873.

File:
1 edited

Legend:

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

    r27710 r27745  
    129129        return 'subdir/theme with spaces';
    130130    }
     131
     132    /**
     133     * @ticket 26873
     134     */
     135    function test_display_method_on_get_method_failure() {
     136        $theme = new WP_Theme( 'nonexistent', $this->theme_root );
     137        $this->assertEquals( 'nonexistent', $theme->get( 'Name' ) );
     138        $this->assertFalse( $theme->get( 'AuthorURI' ) );
     139        $this->assertFalse( $theme->get( 'Tags' ) );
     140        $this->assertFalse( $theme->display( 'Tags' ) );
     141    }
    131142}
Note: See TracChangeset for help on using the changeset viewer.