From 3d8cade8c807feac934df3e0d76289d997091232 Mon Sep 17 00:00:00 2001 From: Boone Gorges Date: Fri, 26 Feb 2016 20:28:07 +0000 Subject: [PATCH] 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 --- tests/phpunit/tests/l10n/getLocale.php | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/tests/phpunit/tests/l10n/getLocale.php b/tests/phpunit/tests/l10n/getLocale.php index 4c4fe8bb02..64b9900ab4 100644 --- a/tests/phpunit/tests/l10n/getLocale.php +++ b/tests/phpunit/tests/l10n/getLocale.php @@ -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();