Changeset 57337 for trunk/tests/phpunit/tests/l10n/wpLocaleSwitcher.php
- Timestamp:
- 01/23/2024 01:32:34 PM (8 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/l10n/wpLocaleSwitcher.php
r55865 r57337 21 21 */ 22 22 protected static $user_id; 23 24 /** 25 * @var WP_Locale_Switcher 26 */ 27 protected $orig_instance; 23 28 24 29 public static function wpSetUpBeforeClass( WP_UnitTest_Factory $factory ) { … … 43 48 $wp_textdomain_registry = new WP_Textdomain_Registry(); 44 49 45 remove_filter( 'locale', array( $wp_locale_switcher, 'filter_locale' ) ); 50 $this->orig_instance = $wp_locale_switcher; 51 52 remove_all_filters( 'locale' ); 53 remove_all_filters( 'determine_locale' ); 54 46 55 $wp_locale_switcher = new WP_Locale_Switcher(); 47 56 $wp_locale_switcher->init(); … … 59 68 restore_current_locale(); 60 69 61 remove_filter( 'locale', array( $wp_locale_switcher, 'filter_locale' ) ); 62 $wp_locale_switcher = new WP_Locale_Switcher(); 63 $wp_locale_switcher->init(); 70 remove_all_filters( 'locale' ); 71 remove_all_filters( 'determine_locale' ); 72 73 $wp_locale_switcher = $this->orig_instance; 74 75 unload_textdomain( 'internationalized-plugin' ); 76 unload_textdomain( 'custom-internationalized-theme' ); 64 77 65 78 parent::tear_down();
Note: See TracChangeset
for help on using the changeset viewer.