Skip to content

Commit

Permalink
Restore previous theme
Browse files Browse the repository at this point in the history
  • Loading branch information
ockham committed Nov 22, 2021
1 parent 8d00e55 commit 0780be0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/phpunit/tests/block-template.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,13 @@
class Block_Template_Test extends WP_UnitTestCase {
private static $post;

private static $previous_theme;

private static $template_canvas_path = ABSPATH . WPINC . '/template-canvas.php';

public static function wpSetUpBeforeClass() {
self::$previous_theme = get_stylesheet();

switch_theme( 'block-theme' );

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

public static function wpTearDownAfterClass() {
wp_delete_post( self::$post->ID );

switch_theme( self::$previous_theme );
}

public function tear_down() {
Expand Down

0 comments on commit 0780be0

Please sign in to comment.