Changeset 52010 for trunk/tests/phpunit/tests/theme.php
- Timestamp:
- 11/04/2021 03:22:47 PM (4 years ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/tests/theme.php (modified) (18 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/theme.php
r51580 r52010 23 23 ); 24 24 25 function set_up() {25 public function set_up() { 26 26 global $wp_theme_directories; 27 27 … … 31 31 $wp_theme_directories = array( WP_CONTENT_DIR . '/themes' ); 32 32 33 add_filter( 'extra_theme_headers', array( $this, ' _theme_data_extra_headers' ) );33 add_filter( 'extra_theme_headers', array( $this, 'theme_data_extra_headers' ) ); 34 34 wp_clean_themes_cache(); 35 35 unset( $GLOBALS['wp_themes'] ); 36 36 } 37 37 38 function tear_down() {38 public function tear_down() { 39 39 global $wp_theme_directories; 40 40 41 41 $wp_theme_directories = $this->wp_theme_directories; 42 42 43 remove_filter( 'extra_theme_headers', array( $this, ' _theme_data_extra_headers' ) );43 remove_filter( 'extra_theme_headers', array( $this, 'theme_data_extra_headers' ) ); 44 44 wp_clean_themes_cache(); 45 45 unset( $GLOBALS['wp_themes'] ); … … 48 48 } 49 49 50 function test_wp_get_themes_default() {50 public function test_wp_get_themes_default() { 51 51 $themes = wp_get_themes(); 52 52 $this->assertInstanceOf( 'WP_Theme', $themes[ $this->theme_slug ] ); … … 62 62 * @expectedDeprecated get_themes 63 63 */ 64 function test_get_themes_default() {64 public function test_get_themes_default() { 65 65 $themes = get_themes(); 66 66 $this->assertInstanceOf( 'WP_Theme', $themes[ $this->theme_name ] ); … … 76 76 * @expectedDeprecated get_themes 77 77 */ 78 function test_get_theme() {78 public function test_get_theme() { 79 79 $themes = get_themes(); 80 80 foreach ( array_keys( $themes ) as $name ) { … … 87 87 } 88 88 89 function test_wp_get_theme() {89 public function test_wp_get_theme() { 90 90 $themes = wp_get_themes(); 91 91 foreach ( $themes as $theme ) { … … 102 102 * @expectedDeprecated get_themes 103 103 */ 104 function test_get_themes_contents() {104 public function test_get_themes_contents() { 105 105 $themes = get_themes(); 106 106 // Generic tests that should hold true for any theme. … … 168 168 } 169 169 170 function test_wp_get_theme_contents() {170 public function test_wp_get_theme_contents() { 171 171 $theme = wp_get_theme( $this->theme_slug ); 172 172 … … 193 193 * @ticket 29925 194 194 */ 195 function test_default_theme_in_default_theme_list() {195 public function test_default_theme_in_default_theme_list() { 196 196 $latest_default_theme = WP_Theme::get_core_default_theme(); 197 197 if ( ! $latest_default_theme->exists() || 'twenty' !== substr( $latest_default_theme->get_stylesheet(), 0, 6 ) ) { … … 201 201 } 202 202 203 function test_default_themes_have_textdomain() {203 public function test_default_themes_have_textdomain() { 204 204 foreach ( $this->default_themes as $theme ) { 205 205 if ( wp_get_theme( $theme )->exists() ) { … … 212 212 * @ticket 48566 213 213 */ 214 function test_year_in_readme() {214 public function test_year_in_readme() { 215 215 // This test is designed to only run on trunk/master. 216 216 $this->skipOnAutomatedBranches(); … … 240 240 * @expectedDeprecated get_theme_data 241 241 */ 242 function test_extra_theme_headers() {242 public function test_extra_theme_headers() { 243 243 $wp_theme = wp_get_theme( $this->theme_slug ); 244 244 $this->assertNotEmpty( $wp_theme->get( 'License' ) ); … … 252 252 } 253 253 254 function _theme_data_extra_headers() {254 public function theme_data_extra_headers() { 255 255 return array( 'License' ); 256 256 } … … 260 260 * @expectedDeprecated get_current_theme 261 261 */ 262 function test_switch_theme() {262 public function test_switch_theme() { 263 263 $themes = get_themes(); 264 264 … … 331 331 } 332 332 333 function test_switch_theme_bogus() {333 public function test_switch_theme_bogus() { 334 334 // Try switching to a theme that doesn't exist. 335 335 $template = rand_str(); … … 353 353 * @covers ::_wp_keep_alive_customize_changeset_dependent_auto_drafts 354 354 */ 355 function test_wp_keep_alive_customize_changeset_dependent_auto_drafts() {355 public function test_wp_keep_alive_customize_changeset_dependent_auto_drafts() { 356 356 $nav_created_post_ids = $this->factory()->post->create_many( 357 357 2, … … 622 622 * @ticket 49406 623 623 * 624 * @dataProvider _dp_register_theme_support_validation624 * @dataProvider data_register_theme_support_validation 625 625 * 626 626 * @param string $error_code The error code expected. … … 634 634 } 635 635 636 public function _dp_register_theme_support_validation() {636 public function data_register_theme_support_validation() { 637 637 return array( 638 638 array(
Note: See TracChangeset
for help on using the changeset viewer.