Skip to content

Commit 76c4db7

Browse files
committed
Restore previous theme
1 parent 6d92813 commit 76c4db7

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

tests/phpunit/tests/block-template.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,13 @@
1111
class Block_Template_Test extends WP_UnitTestCase {
1212
private static $post;
1313

14+
private static $previous_theme;
15+
1416
private static $template_canvas_path = ABSPATH . WPINC . '/template-canvas.php';
1517

1618
public static function wpSetUpBeforeClass() {
19+
self::$previous_theme = get_stylesheet();
20+
1721
switch_theme( 'block-theme' );
1822

1923
// Set up custom template post.
@@ -35,6 +39,8 @@ public static function wpSetUpBeforeClass() {
3539

3640
public static function wpTearDownAfterClass() {
3741
wp_delete_post( self::$post->ID );
42+
43+
switch_theme( self::$previous_theme );
3844
}
3945

4046
public function tear_down() {

0 commit comments

Comments
 (0)