WordPress.org

Make WordPress Core

Changeset 737 in tests


Ignore:
Timestamp:
06/14/12 14:25:17 (23 months ago)
Author:
nacin
Message:

Use wp_clean_themes_cache() to clear WP_Theme and theme root caches before/after running relevant tests. Fixes two broken tests; all now pass. see #WP20954.

Location:
wp-testcase
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • wp-testcase/test_admin_includes_theme.php

    r615 r737  
    1414 
    1515        // clear caches 
    16         search_theme_directories( true ); 
     16        wp_clean_themes_cache(); 
    1717        unset( $GLOBALS['wp_themes'] ); 
    1818    } 
     
    2424        remove_filter( 'template_root', array(&$this, '_theme_root') ); 
    2525 
    26         search_theme_directories( true ); 
     26        wp_clean_themes_cache(); 
    2727        parent::tearDown(); 
    2828    } 
  • wp-testcase/test_includes_class-wp-theme.php

    r598 r737  
    1212        add_filter( 'template_root', array(&$this, '_theme_root') ); 
    1313        // clear caches 
    14         search_theme_directories( true ); 
     14        wp_clean_themes_cache(); 
    1515        unset( $GLOBALS['wp_themes'] ); 
    1616    } 
     
    2121        remove_filter( 'stylesheet_root', array(&$this, '_theme_root') ); 
    2222        remove_filter( 'template_root', array(&$this, '_theme_root') ); 
    23         search_theme_directories( true ); 
     23        wp_clean_themes_cache(); 
    2424        parent::tearDown(); 
    2525    } 
  • wp-testcase/test_includes_theme.php

    r736 r737  
    1010        parent::setUp(); 
    1111        add_filter( 'extra_theme_headers', array( $this, '_theme_data_extra_headers' ) ); 
     12        wp_clean_themes_cache(); 
    1213        unset($GLOBALS['wp_themes']); 
    1314    } 
     
    1617        parent::tearDown(); 
    1718        remove_filter( 'extra_theme_headers', array( $this, '_theme_data_extra_headers' ) ); 
     19        wp_clean_themes_cache(); 
    1820    } 
    1921 
     
    247249        add_filter( 'template_root', array(&$this, '_theme_root') ); 
    248250        // clear caches 
    249         search_theme_directories( true ); 
     251        wp_clean_themes_cache(); 
    250252        unset( $GLOBALS['wp_themes'] ); 
    251253    } 
     
    256258        remove_filter( 'stylesheet_root', array(&$this, '_theme_root') ); 
    257259        remove_filter( 'template_root', array(&$this, '_theme_root') ); 
    258         search_theme_directories( true ); 
     260        wp_clean_themes_cache(); 
    259261        parent::tearDown(); 
    260262    } 
     
    439441 
    440442        // clear caches 
    441         search_theme_directories( true ); 
     443        wp_clean_themes_cache(); 
    442444        unset( $GLOBALS['wp_themes'] ); 
    443445    } 
     
    446448        $GLOBALS['wp_theme_directories'] = $this->orig_theme_dir; 
    447449        remove_filter('theme_root', array(&$this, '_theme_root')); 
    448         search_theme_directories( true ); 
     450        wp_clean_themes_cache(); 
    449451        parent::tearDown(); 
    450452    } 
Note: See TracChangeset for help on using the changeset viewer.