WordPress.org

Make WordPress Core

Changeset 613 in tests


Ignore:
Timestamp:
04/05/12 20:46:18 (3 years ago)
Author:
nacin
Message:

Fix tests in test_admin_includes_theme.php by properly setting up and tearing down theme roots, as well as updating cache-clearing code.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wp-testcase/test_admin_includes_theme.php

    r366 r613  
    77 
    88        $this->orig_theme_dir = $GLOBALS['wp_theme_directories']; 
    9         $GLOBALS['wp_theme_directories'] = $this->theme_root; 
     9        $GLOBALS['wp_theme_directories'] = array( $this->theme_root ); 
    1010 
    1111        add_filter('theme_root', array(&$this, '_theme_root')); 
     12        add_filter( 'stylesheet_root', array(&$this, '_theme_root') ); 
     13        add_filter( 'template_root', array(&$this, '_theme_root') ); 
    1214 
    1315        // clear caches 
    14         unset($GLOBALS['wp_themes']); 
    15         unset($GLOBALS['wp_broken_themes']); 
     16        search_theme_directories( true ); 
     17        unset( $GLOBALS['wp_themes'] ); 
    1618    } 
    1719 
     
    1921        $GLOBALS['wp_theme_directories'] = $this->orig_theme_dir; 
    2022        remove_filter('theme_root', array(&$this, '_theme_root')); 
     23        remove_filter( 'stylesheet_root', array(&$this, '_theme_root') ); 
     24        remove_filter( 'template_root', array(&$this, '_theme_root') ); 
     25 
     26        search_theme_directories( true ); 
    2127        parent::tearDown(); 
    2228    } 
     
    2733    } 
    2834 
    29     // #10959 
    3035    function test_page_templates() { 
     36        $this->knownWPBug(10959); 
    3137        $themes = get_themes(); 
    3238 
Note: See TracChangeset for help on using the changeset viewer.