Changeset 25388
- Timestamp:
- 09/12/2013 05:48:58 AM (11 years ago)
- Location:
- trunk/tests/phpunit/tests
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/theme.php
r25362 r25388 17 17 unset( $GLOBALS['wp_themes'] ); 18 18 19 add_action( 'deprecated_function_run', array( $this, 'deprecated_function_run_check' ) ); 20 } 21 22 function deprecated_function_run_check( $function ) { 23 if ( in_array( $function, array( 'get_theme', 'get_themes', 'get_theme_data', 'get_current_theme' ) ) ) 24 add_filter( 'deprecated_function_trigger_error', array( $this, 'filter_deprecated_function_trigger_error' ) ); 25 } 26 27 function filter_deprecated_function_trigger_error() { 28 remove_filter( 'deprecated_function_trigger_error', array( $this, 'filter_deprecated_function_trigger_error' ) ); 29 return false; 19 add_action( 'deprecated_function_run', array( $this, 'deprecated_function_run' ) ); 30 20 } 31 21 … … 35 25 unset( $GLOBALS['wp_themes'] ); 36 26 parent::tearDown(); 27 28 remove_action( 'deprecated_function_run', array( $this, 'deprecated_function_run' ) ); 29 } 30 31 function deprecated_function_run( $function ) { 32 if ( in_array( $function, array( 'get_theme', 'get_themes', 'get_theme_data', 'get_current_theme' ) ) ) 33 add_filter( 'deprecated_function_trigger_error', array( $this, 'deprecated_function_trigger_error' ) ); 34 } 35 36 function deprecated_function_trigger_error() { 37 remove_filter( 'deprecated_function_trigger_error', array( $this, 'deprecated_function_trigger_error' ) ); 38 return false; 37 39 } 38 40 -
trunk/tests/phpunit/tests/theme/themeDir.php
r25254 r25388 22 22 wp_clean_themes_cache(); 23 23 unset( $GLOBALS['wp_themes'] ); 24 add_action( 'deprecated_function_run', array( $this, 'deprecated_function_run' ) ); 24 25 } 25 26 … … 32 33 unset( $GLOBALS['wp_themes'] ); 33 34 parent::tearDown(); 35 remove_action( 'deprecated_function_run', array( $this, 'deprecated_function_run' ) ); 36 } 37 38 function deprecated_function_run( $function ) { 39 if ( in_array( $function, array( 'get_theme', 'get_themes', 'get_theme_data', 'get_current_theme', 'get_broken_themes' ) ) ) 40 add_filter( 'deprecated_function_trigger_error', array( $this, 'deprecated_function_trigger_error' ) ); 41 } 42 43 function deprecated_function_trigger_error() { 44 remove_filter( 'deprecated_function_trigger_error', array( $this, 'deprecated_function_trigger_error' ) ); 45 return false; 34 46 } 35 47 … … 80 92 $this->assertEquals( 'sandbox', $theme['Template'] ); 81 93 $this->assertEquals( 'sandbox', $theme['Stylesheet'] ); 82 $this->assertEquals( $this->theme_root.'/sandbox/functions.php', reset($theme['Template Files']) ); 83 $this->assertEquals( $this->theme_root.'/sandbox/index.php', next($theme['Template Files']) ); 84 85 $this->assertEquals( $this->theme_root.'/sandbox/style.css', reset($theme['Stylesheet Files']) ); 94 95 $template_files = $theme['Template Files']; 96 97 $this->assertEquals( $this->theme_root.'/sandbox/functions.php', reset( $template_files ) ); 98 $this->assertEquals( $this->theme_root.'/sandbox/index.php', next( $template_files ) ); 99 100 $stylesheet_files = $theme['Stylesheet Files']; 101 102 $this->assertEquals( $this->theme_root.'/sandbox/style.css', reset( $stylesheet_files ) ); 86 103 87 104 $this->assertEquals( $this->theme_root.'/sandbox', $theme['Template Dir'] );
Note: See TracChangeset
for help on using the changeset viewer.