Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add test_switching_themes_recalculates_stylesheet
  • Loading branch information
oandregal committed Jan 20, 2023
commit d39b5e4a697a30c646c47613d5baefa31996c7d4
8 changes: 8 additions & 0 deletions tests/phpunit/tests/theme/wpGetGlobalStylesheet.php
Original file line number Diff line number Diff line change
Expand Up @@ -270,4 +270,12 @@ public function test_should_enqueue_stored_styles() {
'Registered styles with handle of "wp-style-engine-my-styles" do not match expected value from the Style Engine store.'
);
}

public function test_switching_themes_recalculates_stylesheet() {
$stylesheet_for_default_theme = wp_get_global_stylesheet();
switch_theme( 'block-theme' );
$stylesheet_for_block_theme = wp_get_global_stylesheet();
$this->assertStringNotContainsString( '--wp--preset--font-size--custom: 100px;', $stylesheet_for_default_theme, 'custom font size (100px) not present for default theme' );
$this->assertStringContainsString( '--wp--preset--font-size--custom: 100px;', $stylesheet_for_block_theme, 'custom font size (100px) is present for block theme' );
}
}