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

Introduced in [36740].

Props ocean90.
See #35965.

git-svn-id: https://develop.svn.wordpress.org/trunk@36741 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Boone Gorges 2016-02-26 20:28:07 +00:00
parent da128bc5e3
commit 3d8cade8c8
1 changed files with 12 additions and 12 deletions

View File

@ -18,14 +18,14 @@ class Tests_L10n_GetLocale extends WP_UnitTestCase {
}
public function test_local_option_should_take_precedence_on_multisite() {
global $locale;
$old_locale = $locale;
$locale = null;
if ( ! is_multisite() ) {
$this->markTestSkipped( __METHOD__ . ' requires Multisite' );
}
global $locale;
$old_locale = $locale;
$locale = null;
update_option( 'WPLANG', 'en_GB' );
update_site_option( 'WPLANG', 'es_ES' );
@ -36,14 +36,14 @@ class Tests_L10n_GetLocale extends WP_UnitTestCase {
}
public function test_network_option_should_be_fallback_on_multisite() {
global $locale;
$old_locale = $locale;
$locale = null;
if ( ! is_multisite() ) {
$this->markTestSkipped( __METHOD__ . ' requires Multisite' );
}
global $locale;
$old_locale = $locale;
$locale = null;
update_site_option( 'WPLANG', 'es_ES' );
$found = get_locale();
@ -53,14 +53,14 @@ class Tests_L10n_GetLocale extends WP_UnitTestCase {
}
public function test_option_should_be_respected_on_nonmultisite() {
global $locale;
$old_locale = $locale;
$locale = null;
if ( is_multisite() ) {
$this->markTestSkipped( __METHOD__ . ' does not apply to Multisite' );
}
global $locale;
$old_locale = $locale;
$locale = null;
update_option( 'WPLANG', 'es_ES' );
$found = get_locale();