Changeset 25354 for trunk/tests/phpunit/tests/theme.php
- Timestamp:
- 09/11/2013 06:30:06 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/theme.php
r25264 r25354 16 16 wp_clean_themes_cache(); 17 17 unset( $GLOBALS['wp_themes'] ); 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( 'filter_deprecated_function_trigger_error', array( $this, 'filter_deprecated_function_trigger_error' ) ); 29 return false; 18 30 } 19 31 … … 70 82 function test_get_themes_contents() { 71 83 $themes = get_themes(); 72 73 84 // Generic tests that should hold true for any theme 74 foreach ( $themes as $k=>$theme) {75 $this->assertEquals( $theme['Name'], $k);76 $this->assert True(!empty($theme['Title']));85 foreach ( $themes as $k => $theme ) { 86 $this->assertEquals( $theme['Name'], $k ); 87 $this->assertNotEmpty( $theme['Title'] ); 77 88 78 89 // important attributes should all be set … … 101 112 102 113 // important attributes should all not be empty as well 103 $this->assert True(!empty($theme['Description']));104 $this->assert True(!empty($theme['Author']));114 $this->assertNotEmpty( $theme['Description'] ); 115 $this->assertNotEmpty( $theme['Author'] ); 105 116 $this->assertTrue(version_compare($theme['Version'], 0) > 0); 106 $this->assert True(!empty($theme['Template']));107 $this->assert True(!empty($theme['Stylesheet']));117 $this->assertNotEmpty( $theme['Template'] ); 118 $this->assertNotEmpty( $theme['Stylesheet'] ); 108 119 109 120 // template files should all exist … … 180 191 181 192 for ( $i = 0; $i < 3; $i++ ) { 182 foreach ( $themes as $name=>$theme) {193 foreach ( $themes as $name => $theme ) { 183 194 // switch to this theme 184 195 if ( $i === 2 )
Note: See TracChangeset
for help on using the changeset viewer.