Changeset 42343 for trunk/tests/phpunit/tests/l10n/localeSwitcher.php
- Timestamp:
- 11/30/2017 11:09:33 PM (8 years ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/tests/l10n/localeSwitcher.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/l10n/localeSwitcher.php
r39330 r42343 20 20 parent::setUp(); 21 21 22 $this->locale = '';22 $this->locale = ''; 23 23 $this->previous_locale = ''; 24 24 … … 215 215 216 216 public function store_locale( $locale, $previous_locale ) { 217 $this->locale = $locale;217 $this->locale = $locale; 218 218 $this->previous_locale = $previous_locale; 219 219 } … … 252 252 $site_locale = get_locale(); 253 253 254 $user_id = $this->factory()->user->create( array( 255 'role' => 'administrator', 256 'locale' => 'de_DE', 257 ) ); 254 $user_id = $this->factory()->user->create( 255 array( 256 'role' => 'administrator', 257 'locale' => 'de_DE', 258 ) 259 ); 258 260 259 261 wp_set_current_user( $user_id ); … … 272 274 $language_header_before_switch = $l10n['default']->headers['Language']; // de_DE 273 275 274 $locale_switched_user_locale = switch_to_locale( $user_locale ); // False.275 $locale_switched_site_locale = switch_to_locale( $site_locale ); // True.276 $site_locale_after_switch = get_locale();276 $locale_switched_user_locale = switch_to_locale( $user_locale ); // False. 277 $locale_switched_site_locale = switch_to_locale( $site_locale ); // True. 278 $site_locale_after_switch = get_locale(); 277 279 $language_header_after_switch = isset( $l10n['default'] ); // en_US 278 280 … … 301 303 $site_locale = get_locale(); 302 304 303 $user_id = $this->factory()->user->create( array( 304 'role' => 'administrator', 305 'locale' => 'de_DE', 306 ) ); 305 $user_id = $this->factory()->user->create( 306 array( 307 'role' => 'administrator', 308 'locale' => 'de_DE', 309 ) 310 ); 307 311 308 312 wp_set_current_user( $user_id ); … … 321 325 $language_header_before_switch = $l10n['default']->headers['Language']; // de_DE 322 326 323 $locale_switched_user_locale = switch_to_locale( $user_locale ); // False.324 $locale_switched_site_locale = switch_to_locale( $site_locale ); // True.325 $site_locale_after_switch = get_locale();327 $locale_switched_user_locale = switch_to_locale( $user_locale ); // False. 328 $locale_switched_site_locale = switch_to_locale( $site_locale ); // True. 329 $site_locale_after_switch = get_locale(); 326 330 $language_header_after_switch = $l10n['default']->headers['Language']; // es_ES 327 331 … … 349 353 $site_locale = get_locale(); 350 354 351 $user_id = $this->factory()->user->create( array( 352 'role' => 'administrator', 353 'locale' => 'en_GB', 354 ) ); 355 $user_id = $this->factory()->user->create( 356 array( 357 'role' => 'administrator', 358 'locale' => 'en_GB', 359 ) 360 ); 355 361 356 362 wp_set_current_user( $user_id );
Note: See TracChangeset
for help on using the changeset viewer.