Make WordPress Core

Changeset 36741


Ignore:
Timestamp:
02/26/2016 08:28:07 PM (11 years ago)
Author:
boonebgorges
Message:

Tests: Don't modify global state before checking whether to skip get_locale() tests.

Introduced in [36740].

Props ocean90.
See #35965.

File:
1 edited

Legend:

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

    r36740 r36741  
    1919
    2020        public function test_local_option_should_take_precedence_on_multisite() {
     21                if ( ! is_multisite() ) {
     22                        $this->markTestSkipped( __METHOD__ . ' requires Multisite' );
     23                }
     24
    2125                global $locale;
    2226                $old_locale = $locale;
    2327                $locale = null;
    24 
    25                 if ( ! is_multisite() ) {
    26                         $this->markTestSkipped( __METHOD__ . ' requires Multisite' );
    27                 }
    2828
    2929                update_option( 'WPLANG', 'en_GB' );
    … …  
    3737
    3838        public function test_network_option_should_be_fallback_on_multisite() {
     39                if ( ! is_multisite() ) {
     40                        $this->markTestSkipped( __METHOD__ . ' requires Multisite' );
     41                }
     42
    3943                global $locale;
    4044                $old_locale = $locale;
    4145                $locale = null;
    42 
    43                 if ( ! is_multisite() ) {
    44                         $this->markTestSkipped( __METHOD__ . ' requires Multisite' );
    45                 }
    4646
    4747                update_site_option( 'WPLANG', 'es_ES' );
    … …  
    5454
    5555        public function test_option_should_be_respected_on_nonmultisite() {
     56                if ( is_multisite() ) {
     57                        $this->markTestSkipped( __METHOD__ . ' does not apply to Multisite' );
     58                }
     59
    5660                global $locale;
    5761                $old_locale = $locale;
    5862                $locale = null;
    59 
    60                 if ( is_multisite() ) {
    61                         $this->markTestSkipped( __METHOD__ . ' does not apply to Multisite' );
    62                 }
    6363
    6464                update_option( 'WPLANG', 'es_ES' );
Note: See TracChangeset for help on using the changeset viewer.