Make WordPress Core


Ignore:
Timestamp:
07/13/2021 04:13:01 PM (4 years ago)
Author:
SergeyBiryukov
Message:

Tests: Reset $current_screen global between tests to avoid cross-test interdependencies.

This provides a consistent global starting state for tests that interact with admin screens.

Individual tests no longer need to invoke set_current_screen( 'front' ) (or an alternative implementation) as a reset.

Follow-up to [29251], [29860], [31046], [36721], [38678], [48908], [50433].

Props hellofromTonya, johnbillion.
Fixes #53431.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/l10n/loadTextdomainJustInTime.php

    r50926 r51419  
    212212        $expected = i18n_plugin_test();
    213213
    214         set_current_screen( 'front' );
    215 
    216214        $this->assertSame( 'Das ist ein Dummy Plugin', $expected );
    217215    }
     
    229227        $expected = i18n_theme_test();
    230228
    231         set_current_screen( 'front' );
    232229        switch_theme( WP_DEFAULT_THEME );
    233230
Note: See TracChangeset for help on using the changeset viewer.