Skip to content
Draft
Changes from all commits
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
12 changes: 12 additions & 0 deletions tests/phpunit/tests/general/template.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,17 @@ public static function wpTearDownAfterClass() {
remove_theme_support( 'custom-logo' );
}

/**
* Original stylesheet before the test switches themes.
*
* @var string
*/
private $original_stylesheet;

public function set_up() {
parent::set_up();

$this->original_stylesheet = get_stylesheet();
switch_theme( 'default' );
$this->wp_site_icon = new WP_Site_Icon();
}
Expand All @@ -104,6 +112,10 @@ public function tear_down() {
$this->remove_site_icon();
$wp_customize = null;

if ( get_stylesheet() !== $this->original_stylesheet ) {
switch_theme( $this->original_stylesheet );
}

parent::tear_down();
}

Expand Down
Loading