Make WordPress Core

Changeset 25362


Ignore:
Timestamp:
09/11/2013 09:32:14 PM (11 years ago)
Author:
wonderboymusic
Message:

Restore the test code for get_theme(), add the notice suppression filters, and fix the type in the remove_filter() call.

See #25282.

Location:
trunk/tests/phpunit/tests
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/admin/includesTheme.php

    r25355 r25362  
    1818        wp_clean_themes_cache();
    1919        unset( $GLOBALS['wp_themes'] );
     20       
     21        add_action( 'deprecated_function_run', array( $this, 'deprecated_function_run_check' ) );
     22    }
     23
     24    function deprecated_function_run_check( $function ) {
     25        if ( in_array( $function, array( 'get_theme', 'get_themes', 'get_theme_data', 'get_current_theme' ) ) )
     26            add_filter( 'deprecated_function_trigger_error', array( $this, 'filter_deprecated_function_trigger_error' ) );
     27    }
     28
     29    function filter_deprecated_function_trigger_error() {
     30        remove_filter( 'deprecated_function_trigger_error', array( $this, 'filter_deprecated_function_trigger_error' ) );
     31        return false;
    2032    }
    2133
     
    4153     */
    4254    function test_page_templates() {
     55        $theme = get_theme( 'Page Template Theme' );
     56        $this->assertNotEmpty( $theme );
     57
     58        switch_theme( $theme['Template'], $theme['Stylesheet'] );
     59
     60        $templates = get_page_templates();
     61        $this->assertCount( 3, $templates );
     62        $this->assertEquals( "template-top-level.php", $templates['Top Level'] );
     63        $this->assertEquals( "subdir/template-sub-dir.php", $templates['Sub Dir'] );
     64        $this->assertEquals( "template-header.php", $templates['This Template Header Is On One Line'] );
     65
    4366        $theme = wp_get_theme( 'page-templates' );
    4467        $this->assertNotEmpty( $theme );
  • trunk/tests/phpunit/tests/theme.php

    r25354 r25362  
    2626
    2727    function filter_deprecated_function_trigger_error() {
    28         remove_filter( 'filter_deprecated_function_trigger_error', array( $this, 'filter_deprecated_function_trigger_error' ) );
     28        remove_filter( 'deprecated_function_trigger_error', array( $this, 'filter_deprecated_function_trigger_error' ) );
    2929        return false;
    3030    }
Note: See TracChangeset for help on using the changeset viewer.