- Timestamp:
- 11/25/2021 07:39:31 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/l10n/loadTextdomainJustInTime.php
r51568 r52248 70 70 71 71 $is_textdomain_loaded_before = is_textdomain_loaded( 'internationalized-plugin' ); 72 $ expected_output= i18n_plugin_test();72 $actual_output = i18n_plugin_test(); 73 73 $is_textdomain_loaded_after = is_textdomain_loaded( 'internationalized-plugin' ); 74 74 … … 76 76 77 77 $this->assertFalse( $is_textdomain_loaded_before ); 78 $this->assertSame( 'Das ist ein Dummy Plugin', $ expected_output );78 $this->assertSame( 'Das ist ein Dummy Plugin', $actual_output ); 79 79 $this->assertTrue( $is_textdomain_loaded_after ); 80 80 } … … 91 91 92 92 $is_textdomain_loaded_before = is_textdomain_loaded( 'internationalized-theme' ); 93 $ expected_output= i18n_theme_test();93 $actual_output = i18n_theme_test(); 94 94 $is_textdomain_loaded_after = is_textdomain_loaded( 'internationalized-theme' ); 95 95 … … 97 97 98 98 $this->assertFalse( $is_textdomain_loaded_before ); 99 $this->assertSame( 'Das ist ein Dummy Theme', $ expected_output );99 $this->assertSame( 'Das ist ein Dummy Theme', $actual_output ); 100 100 $this->assertTrue( $is_textdomain_loaded_after ); 101 101 } … … 122 122 require_once DIR_TESTDATA . '/plugins/internationalized-plugin.php'; 123 123 124 $ expected_output_before= i18n_plugin_test();124 $actual_output_before = i18n_plugin_test(); 125 125 $is_textdomain_loaded_before = is_textdomain_loaded( 'internationalized-plugin' ); 126 126 … … 128 128 remove_filter( 'locale', array( $this, 'filter_set_locale_to_german' ) ); 129 129 130 $ expected_output_after= i18n_plugin_test();130 $actual_output_after = i18n_plugin_test(); 131 131 $is_textdomain_loaded_after = is_textdomain_loaded( 'internationalized-plugin' ); 132 132 … … 134 134 load_textdomain( 'internationalized-plugin', WP_LANG_DIR . '/plugins/internationalized-plugin-de_DE.mo' ); 135 135 136 $ expected_output_final= i18n_plugin_test();136 $actual_output_final = i18n_plugin_test(); 137 137 $is_textdomain_loaded_final = is_textdomain_loaded( 'internationalized-plugin' ); 138 138 … … 141 141 142 142 // Text domain loaded just in time. 143 $this->assertSame( 'Das ist ein Dummy Plugin', $ expected_output_before );143 $this->assertSame( 'Das ist ein Dummy Plugin', $actual_output_before ); 144 144 $this->assertTrue( $is_textdomain_loaded_before ); 145 145 146 146 // Text domain unloaded. 147 $this->assertSame( 'This is a dummy plugin', $ expected_output_after );147 $this->assertSame( 'This is a dummy plugin', $actual_output_after ); 148 148 $this->assertFalse( $is_textdomain_loaded_after ); 149 149 150 150 // Text domain loaded manually again. 151 $this->assertSame( 'Das ist ein Dummy Plugin', $ expected_output_final );151 $this->assertSame( 'Das ist ein Dummy Plugin', $actual_output_final ); 152 152 $this->assertTrue( $is_textdomain_loaded_final ); 153 153 } … … 160 160 161 161 switch_to_locale( 'de_DE' ); 162 $ expected= i18n_plugin_test();162 $actual = i18n_plugin_test(); 163 163 restore_previous_locale(); 164 164 165 $this->assertSame( 'Das ist ein Dummy Plugin', $ expected);165 $this->assertSame( 'Das ist ein Dummy Plugin', $actual ); 166 166 } 167 167 … … 173 173 174 174 switch_to_locale( 'de_DE' ); 175 $ expected_de_de = i18n_plugin_test();175 $actual_de_de = i18n_plugin_test(); 176 176 177 177 switch_to_locale( 'es_ES' ); 178 $ expected_es_es = i18n_plugin_test();178 $actual_es_es = i18n_plugin_test(); 179 179 180 180 restore_current_locale(); 181 181 182 $this->assertSame( 'Das ist ein Dummy Plugin', $ expected_de_de );183 $this->assertSame( 'This is a dummy plugin', $ expected_es_es );182 $this->assertSame( 'Das ist ein Dummy Plugin', $actual_de_de ); 183 $this->assertSame( 'This is a dummy plugin', $actual_es_es ); 184 184 } 185 185 … … 193 193 194 194 switch_to_locale( 'de_DE' ); 195 $ expected= i18n_theme_test();195 $actual = i18n_theme_test(); 196 196 restore_previous_locale(); 197 197 198 198 switch_theme( WP_DEFAULT_THEME ); 199 199 200 $this->assertSame( 'Das ist ein Dummy Theme', $ expected);200 $this->assertSame( 'Das ist ein Dummy Theme', $actual ); 201 201 } 202 202 … … 210 210 wp_set_current_user( self::$user_id ); 211 211 212 $ expected= i18n_plugin_test();213 214 $this->assertSame( 'Das ist ein Dummy Plugin', $ expected);212 $actual = i18n_plugin_test(); 213 214 $this->assertSame( 'Das ist ein Dummy Plugin', $actual ); 215 215 } 216 216 … … 225 225 require_once get_stylesheet_directory() . '/functions.php'; 226 226 227 $ expected= i18n_theme_test();227 $actual = i18n_theme_test(); 228 228 229 229 switch_theme( WP_DEFAULT_THEME ); 230 230 231 $this->assertSame( 'Das ist ein Dummy Theme', $ expected);231 $this->assertSame( 'Das ist ein Dummy Theme', $actual ); 232 232 } 233 233
Note: See TracChangeset
for help on using the changeset viewer.