diff --git a/tests/phpunit/tests/ajax/wpAjaxHeartbeat.php b/tests/phpunit/tests/ajax/wpAjaxHeartbeat.php index 87d49987b5752..01e5e63c6de60 100644 --- a/tests/phpunit/tests/ajax/wpAjaxHeartbeat.php +++ b/tests/phpunit/tests/ajax/wpAjaxHeartbeat.php @@ -39,6 +39,7 @@ public static function wpSetUpBeforeClass( WP_UnitTest_Factory $factory ) { self::$post_id = $factory->post->create( array( 'post_status' => 'draft' ) ); self::$post = get_post( self::$post_id ); + wp_set_current_user( 0 ); } /** diff --git a/tests/phpunit/tests/post/wpGetAutoSave.php b/tests/phpunit/tests/post/wpGetAutoSave.php index db27d25fad58d..a3449820fc4e7 100644 --- a/tests/phpunit/tests/post/wpGetAutoSave.php +++ b/tests/phpunit/tests/post/wpGetAutoSave.php @@ -37,6 +37,7 @@ public static function wpSetUpBeforeClass( WP_UnitTest_Factory $factory ) { wp_set_current_user( self::$admin_id ); self::$post_id = $factory->post->create( array( 'post_status' => 'publish' ) ); + wp_set_current_user( 0 ); } /** diff --git a/tests/phpunit/tests/rest-api/rest-autosaves-controller.php b/tests/phpunit/tests/rest-api/rest-autosaves-controller.php index be6a1996ee98a..42f76b931de02 100644 --- a/tests/phpunit/tests/rest-api/rest-autosaves-controller.php +++ b/tests/phpunit/tests/rest-api/rest-autosaves-controller.php @@ -108,6 +108,7 @@ public static function wpSetUpBeforeClass( WP_UnitTest_Factory $factory ) { 'post_author' => self::$editor_id, ) ); + wp_set_current_user( 0 ); } public static function wpTearDownAfterClass() { diff --git a/tests/phpunit/tests/rest-api/wpRestTemplateAutosavesController.php b/tests/phpunit/tests/rest-api/wpRestTemplateAutosavesController.php index 972cdccdb034d..246c7562a6be6 100644 --- a/tests/phpunit/tests/rest-api/wpRestTemplateAutosavesController.php +++ b/tests/phpunit/tests/rest-api/wpRestTemplateAutosavesController.php @@ -131,6 +131,7 @@ public static function wpSetUpBeforeClass( WP_UnitTest_Factory $factory ) { ); wp_set_post_terms( self::$template_part_post->ID, self::TEST_THEME, 'wp_theme' ); wp_set_post_terms( self::$template_part_post->ID, WP_TEMPLATE_PART_AREA_HEADER, 'wp_template_part_area' ); + wp_set_current_user( 0 ); } /** diff --git a/tests/phpunit/tests/rest-api/wpRestTemplateRevisionsController.php b/tests/phpunit/tests/rest-api/wpRestTemplateRevisionsController.php index 3475c87d68750..88a4b548bfa9f 100644 --- a/tests/phpunit/tests/rest-api/wpRestTemplateRevisionsController.php +++ b/tests/phpunit/tests/rest-api/wpRestTemplateRevisionsController.php @@ -222,6 +222,7 @@ public static function wpSetUpBeforeClass( WP_UnitTest_Factory $factory ) { ); wp_set_post_terms( self::$template_part_post_2->ID, self::TEST_THEME, 'wp_theme' ); wp_set_post_terms( self::$template_part_post_2->ID, WP_TEMPLATE_PART_AREA_HEADER, 'wp_template_part_area' ); + wp_set_current_user( 0 ); } /**