WordPress.org

Make WordPress Core

Changeset 50433


Ignore:
Timestamp:
02/25/2021 11:10:46 AM (7 months ago)
Author:
SergeyBiryukov
Message:

Tests: Reset current screen after setting it to dashboard in add_submenu_page() tests.

This avoids polluting other tests and allows the ms-excluded test group to successfully run on its own.

Props johnbillion, SergeyBiryukov.
See #52607.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/admin/includesPlugin.php

    r49566 r50433  
    9090        // Clean up the temporary user.
    9191        wp_delete_user( $admin_user );
     92        // Reset current screen.
     93        set_current_screen( 'front' );
    9294
    9395        // Verify the menu was inserted at the expected position.
     
    198200        // Clean up the temporary user.
    199201        wp_delete_user( $admin_user );
     202        // Reset current screen.
     203        set_current_screen( 'front' );
    200204
    201205        foreach ( $actual_positions as $test => $actual_position ) {
     
    281285        wp_set_current_user( $current_user );
    282286        wp_delete_user( $admin_user );
     287        // Reset current screen.
     288        set_current_screen( 'front' );
    283289
    284290        // Verify the menu was inserted at the expected position.
     
    312318        wp_set_current_user( $current_user );
    313319        wp_delete_user( $admin_user );
     320        // Reset current screen.
     321        set_current_screen( 'front' );
    314322
    315323        // Verify the menu was inserted at the expected position.
Note: See TracChangeset for help on using the changeset viewer.