Skip to content
Merged
Show file tree
Hide file tree
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
6 changes: 2 additions & 4 deletions phpunit/block-template-utils-test.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ class Tests_Block_Template_Utils extends WP_UnitTestCase {
public function set_up() {
parent::set_up();
switch_theme( 'emptytheme' );
}

public static function wpSetUpBeforeClass() {
register_post_type(
'custom_book',
array(
Expand All @@ -22,9 +19,10 @@ public static function wpSetUpBeforeClass() {
register_taxonomy( 'book_type', 'custom_book' );
}

public static function wpTearDownAfterClass() {
public function tear_down() {
unregister_post_type( 'custom_book' );
unregister_taxonomy( 'book_type' );
parent::tear_down();
}

public function test_get_template_hierarchy() {
Expand Down
3 changes: 3 additions & 0 deletions phpunit/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
if ( ! defined( 'LOCAL_WP_ENVIRONMENT_TYPE' ) ) {
define( 'LOCAL_WP_ENVIRONMENT_TYPE', 'local' );
}
if ( ! defined( 'WP_RUN_CORE_TESTS' ) ) {
define( 'WP_RUN_CORE_TESTS', true );
}

// Require composer dependencies.
require_once dirname( __DIR__ ) . '/vendor/autoload.php';
Expand Down