Changeset 59869 for trunk/tests/phpunit/tests/post/getBodyClass.php
- Timestamp:
- 02/25/2025 10:05:12 PM (10 months ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/tests/post/getBodyClass.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/post/getBodyClass.php
r59689 r59869 259 259 $this->assertContains( "page-id-{$page_id}", $class ); 260 260 } 261 262 /** 263 * Test theme-related body classes. 264 * 265 * @ticket 19736 266 */ 267 public function test_theme_body_classes() { 268 $original_theme = wp_get_theme(); 269 270 switch_theme( 'block-theme' ); 271 do_action( 'setup_theme' ); 272 do_action( 'after_setup_theme' ); 273 274 $classes = get_body_class(); 275 $this->assertContains( 'wp-theme-block-theme', $classes, 'Parent theme body class not found' ); 276 277 switch_theme( 'block-theme-child' ); 278 do_action( 'setup_theme' ); 279 do_action( 'after_setup_theme' ); 280 281 $classes = get_body_class(); 282 $this->assertContains( 'wp-theme-block-theme', $classes, 'Parent theme body class not found in child theme context' ); 283 $this->assertContains( 'wp-child-theme-block-theme-child', $classes, 'Child theme body class not found' ); 284 285 switch_theme( $original_theme->get_stylesheet() ); 286 do_action( 'setup_theme' ); 287 do_action( 'after_setup_theme' ); 288 } 261 289 }
Note: See TracChangeset
for help on using the changeset viewer.