Changeset 52010 for trunk/tests/phpunit/tests/theme/themeDir.php
- Timestamp:
- 11/04/2021 03:22:47 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/theme/themeDir.php
r51568 r52010 8 8 class Tests_Theme_ThemeDir extends WP_UnitTestCase { 9 9 10 function set_up() {10 public function set_up() { 11 11 parent::set_up(); 12 12 $this->theme_root = DIR_TESTDATA . '/themedir1'; … … 17 17 $GLOBALS['wp_theme_directories'] = array( WP_CONTENT_DIR . '/themes', $this->theme_root ); 18 18 19 add_filter( 'theme_root', array( $this, ' _theme_root' ) );20 add_filter( 'stylesheet_root', array( $this, ' _theme_root' ) );21 add_filter( 'template_root', array( $this, ' _theme_root' ) );19 add_filter( 'theme_root', array( $this, 'filter_theme_root' ) ); 20 add_filter( 'stylesheet_root', array( $this, 'filter_theme_root' ) ); 21 add_filter( 'template_root', array( $this, 'filter_theme_root' ) ); 22 22 // Clear caches. 23 23 wp_clean_themes_cache(); … … 25 25 } 26 26 27 function tear_down() {27 public function tear_down() { 28 28 $GLOBALS['wp_theme_directories'] = $this->orig_theme_dir; 29 29 wp_clean_themes_cache(); … … 33 33 34 34 // Replace the normal theme root directory with our premade test directory. 35 function_theme_root( $dir ) {35 public function filter_theme_root( $dir ) { 36 36 return $this->theme_root; 37 37 } … … 41 41 * @expectedDeprecated get_themes 42 42 */ 43 function test_theme_default() {43 public function test_theme_default() { 44 44 $themes = get_themes(); 45 45 $theme = get_theme( 'WordPress Default' ); … … 72 72 * @expectedDeprecated get_themes 73 73 */ 74 function test_theme_sandbox() {74 public function test_theme_sandbox() { 75 75 $theme = get_theme( 'Sandbox' ); 76 76 … … 108 108 * @expectedDeprecated get_themes 109 109 */ 110 function test_theme_stylesheet_only() {110 public function test_theme_stylesheet_only() { 111 111 $themes = get_themes(); 112 112 … … 138 138 * @expectedDeprecated get_themes 139 139 */ 140 function test_theme_list() {140 public function test_theme_list() { 141 141 $themes = get_themes(); 142 142 … … 175 175 * @expectedDeprecated get_broken_themes 176 176 */ 177 function test_broken_themes() {177 public function test_broken_themes() { 178 178 $themes = get_themes(); 179 179 … … 194 194 } 195 195 196 function test_wp_get_theme_with_non_default_theme_root() {196 public function test_wp_get_theme_with_non_default_theme_root() { 197 197 $this->assertFalse( wp_get_theme( 'sandbox', $this->theme_root )->errors() ); 198 198 $this->assertFalse( wp_get_theme( 'sandbox' )->errors() ); … … 202 202 * @expectedDeprecated get_themes 203 203 */ 204 function test_page_templates() {204 public function test_page_templates() { 205 205 $themes = get_themes(); 206 206 … … 215 215 * @expectedDeprecated get_theme_data 216 216 */ 217 function test_get_theme_data_top_level() {217 public function test_get_theme_data_top_level() { 218 218 $theme_data = get_theme_data( DIR_TESTDATA . '/themedir1/theme1/style.css' ); 219 219 … … 234 234 * @expectedDeprecated get_theme_data 235 235 */ 236 function test_get_theme_data_subdir() {236 public function test_get_theme_data_subdir() { 237 237 $theme_data = get_theme_data( $this->theme_root . '/subdir/theme2/style.css' ); 238 238 … … 253 253 * @ticket 28662 254 254 */ 255 function test_theme_dir_slashes() {255 public function test_theme_dir_slashes() { 256 256 $size = count( $GLOBALS['wp_theme_directories'] ); 257 257
Note: See TracChangeset
for help on using the changeset viewer.