Changeset 25362
- Timestamp:
- 09/11/2013 09:32:14 PM (11 years ago)
- Location:
- trunk/tests/phpunit/tests
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/admin/includesTheme.php
r25355 r25362 18 18 wp_clean_themes_cache(); 19 19 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; 20 32 } 21 33 … … 41 53 */ 42 54 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 43 66 $theme = wp_get_theme( 'page-templates' ); 44 67 $this->assertNotEmpty( $theme ); -
trunk/tests/phpunit/tests/theme.php
r25354 r25362 26 26 27 27 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' ) ); 29 29 return false; 30 30 }
Note: See TracChangeset
for help on using the changeset viewer.