diff --git a/tests/phpunit/tests/admin/includesPlugin.php b/tests/phpunit/tests/admin/includesPlugin.php index d880e240c9..aacccbefd3 100644 --- a/tests/phpunit/tests/admin/includesPlugin.php +++ b/tests/phpunit/tests/admin/includesPlugin.php @@ -89,6 +89,8 @@ class Tests_Admin_includesPlugin extends WP_UnitTestCase { // Clean up the temporary user. wp_delete_user( $admin_user ); + // Reset current screen. + set_current_screen( 'front' ); // Verify the menu was inserted at the expected position. $this->assertSame( 'custom-position', $submenu[ $parent ][ $expected_position ][2] ); @@ -197,6 +199,8 @@ class Tests_Admin_includesPlugin extends WP_UnitTestCase { // Clean up the temporary user. wp_delete_user( $admin_user ); + // Reset current screen. + set_current_screen( 'front' ); foreach ( $actual_positions as $test => $actual_position ) { // Verify the menu was inserted at the expected position. @@ -280,6 +284,8 @@ class Tests_Admin_includesPlugin extends WP_UnitTestCase { // Clean up the temporary user. wp_set_current_user( $current_user ); wp_delete_user( $admin_user ); + // Reset current screen. + set_current_screen( 'front' ); // Verify the menu was inserted at the expected position. $this->assertSame( 'main_slug', $submenu['main_slug'][0][2] ); @@ -311,6 +317,8 @@ class Tests_Admin_includesPlugin extends WP_UnitTestCase { // Clean up the temporary user. wp_set_current_user( $current_user ); wp_delete_user( $admin_user ); + // Reset current screen. + set_current_screen( 'front' ); // Verify the menu was inserted at the expected position. $this->assertSame( 'submenu_page_1', $submenu['main_slug'][1][2] );