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/loadTextdomain.php

    r50463 r51419  
    196196        load_muplugin_textdomain( 'wp-tests-domain' );
    197197
    198         set_current_screen( 'front' );
    199 
    200198        $this->assertSame( get_user_locale(), $this->locale );
    201199    }
     
    216214        load_plugin_textdomain( 'wp-tests-domain' );
    217215
    218         set_current_screen( 'front' );
    219 
    220216        $this->assertSame( get_user_locale(), $this->locale );
    221217    }
     
    236232        load_theme_textdomain( 'wp-tests-domain' );
    237233
    238         set_current_screen( 'front' );
    239 
    240234        $this->assertSame( get_user_locale(), $this->locale );
    241235    }
Note: See TracChangeset for help on using the changeset viewer.