Changeset 53866 for trunk/tests/phpunit/tests/l10n/wpLocaleSwitcher.php
- Timestamp:
- 08/08/2022 11:39:06 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/l10n/wpLocaleSwitcher.php
r52248 r53866 36 36 } 37 37 38 /** 39 * @covers ::switch_to_locale 40 */ 38 41 public function test_switch_to_non_existent_locale_returns_false() { 39 42 $this->assertFalse( switch_to_locale( 'foo_BAR' ) ); 40 43 } 41 44 45 /** 46 * @covers ::switch_to_locale 47 */ 42 48 public function test_switch_to_non_existent_locale_does_not_change_locale() { 43 49 switch_to_locale( 'foo_BAR' ); … … 46 52 } 47 53 54 /** 55 * @covers ::switch_to_locale 56 */ 48 57 public function test_switch_to_locale_returns_true() { 49 58 $expected = switch_to_locale( 'en_GB' ); … … 55 64 } 56 65 66 /** 67 * @covers ::switch_to_locale 68 */ 57 69 public function test_switch_to_locale_changes_the_locale() { 58 70 switch_to_locale( 'en_GB' ); … … 66 78 } 67 79 80 /** 81 * @covers ::switch_to_locale 82 * @covers ::translate 83 * @covers ::__ 84 */ 68 85 public function test_switch_to_locale_loads_translation() { 69 86 switch_to_locale( 'es_ES' ); … … 77 94 } 78 95 96 /** 97 * @covers ::switch_to_locale 98 */ 79 99 public function test_switch_to_locale_changes_wp_locale_global() { 80 100 global $wp_locale; … … 95 115 } 96 116 117 /** 118 * @covers ::switch_to_locale 119 */ 97 120 public function test_switch_to_locale_en_US() { 98 121 switch_to_locale( 'en_GB' ); … … 108 131 } 109 132 133 /** 134 * @covers ::switch_to_locale 135 */ 110 136 public function test_switch_to_locale_multiple_times() { 111 137 switch_to_locale( 'en_GB' ); … … 120 146 } 121 147 148 /** 149 * @covers ::switch_to_locale 150 * @covers ::__ 151 * @covers ::translate 152 */ 122 153 public function test_switch_to_locale_multiple_times_loads_translation() { 123 154 switch_to_locale( 'en_GB' ); … … 135 166 } 136 167 168 /** 169 * @covers ::restore_previous_locale 170 */ 137 171 public function test_restore_previous_locale_without_switching() { 138 172 $this->assertFalse( restore_previous_locale() ); 139 173 } 140 174 175 /** 176 * @covers ::restore_previous_locale 177 */ 141 178 public function test_restore_previous_locale_changes_the_locale_back() { 142 179 switch_to_locale( 'en_GB' ); … … 148 185 } 149 186 187 /** 188 * @covers ::restore_previous_locale 189 */ 150 190 public function test_restore_previous_locale_after_switching_multiple_times() { 151 191 switch_to_locale( 'en_GB' ); … … 161 201 } 162 202 203 /** 204 * @covers ::restore_previous_locale 205 * @covers ::__ 206 * @covers ::translate 207 */ 163 208 public function test_restore_previous_locale_restores_translation() { 164 209 switch_to_locale( 'es_ES' ); … … 170 215 } 171 216 217 /** 218 * @covers ::restore_previous_locale 219 */ 172 220 public function test_restore_previous_locale_action_passes_previous_locale() { 173 221 switch_to_locale( 'en_GB' ); … … 186 234 } 187 235 236 /** 237 * @covers ::restore_previous_locale 238 */ 188 239 public function test_restore_previous_locale_restores_wp_locale_global() { 189 240 global $wp_locale; … … 200 251 } 201 252 253 /** 254 * @covers ::restore_current_locale 255 */ 202 256 public function test_restore_current_locale_without_switching() { 203 257 $this->assertFalse( restore_current_locale() ); 204 258 } 205 259 260 /** 261 * @covers ::restore_previous_locale 262 */ 206 263 public function test_restore_current_locale_after_switching_multiple_times() { 207 264 switch_to_locale( 'en_GB' ); … … 219 276 } 220 277 278 /** 279 * @covers ::is_locale_switched 280 */ 221 281 public function test_is_locale_switched_if_not_switched() { 222 282 $this->assertFalse( is_locale_switched() ); 223 283 } 224 284 285 /** 286 * @covers ::is_locale_switched 287 */ 225 288 public function test_is_locale_switched_original_locale() { 226 289 $original_locale = get_locale(); … … 236 299 } 237 300 301 /** 302 * @covers ::is_locale_switched 303 */ 238 304 public function test_is_locale_switched() { 239 305 switch_to_locale( 'en_GB' ); … … 247 313 } 248 314 315 /** 316 * @covers ::switch_to_locale 317 */ 249 318 public function test_switch_to_site_locale_if_user_locale_is_set() { 250 319 global $l10n, $wp_locale_switcher; … … 293 362 } 294 363 364 /** 365 * @covers ::switch_to_locale 366 */ 295 367 public function test_switch_to_different_site_locale_if_user_locale_is_set() { 296 368 global $l10n, $wp_locale_switcher; … … 344 416 } 345 417 418 /** 419 * @covers ::switch_to_locale 420 * @covers ::load_default_textdomain 421 */ 346 422 public function test_multiple_switches_to_site_locale_and_user_locale() { 347 423 global $wp_locale_switcher;
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)