Changeset 1271 in tests
- Timestamp:
- 04/23/2013 01:38:08 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/db.php
r1108 r1271 50 50 global $wpdb; 51 51 52 // Save the current locale 53 $current_locale = setlocale( LC_ALL, NULL);52 // Save the current locale settings 53 $current_locales = explode( ';', setlocale( LC_ALL, 0 ) ); 54 54 55 55 // Switch to Russian … … 76 76 $this->assertContains( '0.700', $sql ); 77 77 78 // Restore locale 79 setlocale( LC_ALL, $current_locale ); 78 // Restore locale settings 79 foreach ( $current_locales as $locale_setting ) { 80 if ( false !== strpos( $locale_setting, '=' ) ) { 81 list( $category, $locale ) = explode( '=', $locale_setting ); 82 setlocale( constant( $category ), $locale ); 83 } else { 84 setlocale( LC_ALL, $locale_setting ); 85 } 86 } 80 87 } 81 88
Note: See TracChangeset
for help on using the changeset viewer.