Changeset 57286 for trunk/tests/phpunit/tests/l10n/determineLocale.php
- Timestamp:
- 01/15/2024 06:55:59 PM (18 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/l10n/determineLocale.php
r56559 r57286 21 21 22 22 public function tear_down() { 23 unset( $_SERVER['CONTENT_TYPE'], $_GET['_locale'], $_COOKIE['wp_lang'], $GLOBALS['pagenow'] ); 23 unset( 24 $_SERVER['CONTENT_TYPE'], 25 $_GET['_locale'], 26 $_COOKIE['wp_lang'], 27 $GLOBALS['pagenow'], 28 $GLOBALS['wp_local_package'], 29 $_REQUEST['language'] 30 ); 31 wp_installing( false ); 24 32 25 33 parent::tear_down(); … … 274 282 $this->assertSame( 'siteLocale', determine_locale() ); 275 283 } 284 285 public function test_language_param_not_installing() { 286 $_REQUEST['language'] = 'de_DE'; 287 $this->assertSame( 'en_US', determine_locale() ); 288 } 289 290 public function test_language_param_installing() { 291 $_REQUEST['language'] = 'de_DE'; 292 wp_installing( true ); 293 $this->assertSame( 'de_DE', determine_locale() ); 294 } 295 296 public function test_language_param_installing_incorrect_string() { 297 $_REQUEST['language'] = '####'; // Something sanitize_locale_name() strips away. 298 wp_installing( true ); 299 $this->assertSame( 'en_US', determine_locale() ); 300 } 301 302 public function test_wp_local_package_global_not_installing() { 303 $_REQUEST['language'] = 'de_DE'; 304 $this->assertSame( 'en_US', determine_locale() ); 305 } 306 public function test_wp_local_package_global_installing() { 307 $_REQUEST['language'] = 'de_DE'; 308 wp_installing( true ); 309 $this->assertSame( 'de_DE', determine_locale() ); 310 } 276 311 }
Note: See TracChangeset
for help on using the changeset viewer.