Changeset 53866
- Timestamp:
- 08/08/2022 11:39:06 PM (2 years ago)
- Location:
- trunk/tests/phpunit/tests
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/l10n.php
r53543 r53866 18 18 /** 19 19 * @ticket 35961 20 * 21 * @covers ::_n_noop 20 22 */ 21 23 public function test_n_noop() { … … 31 33 /** 32 34 * @ticket 35961 35 * 36 * @covers ::_nx_noop 33 37 */ 34 38 public function test_nx_noop() { … … 45 49 /** 46 50 * @ticket 35073 51 * 52 * @covers ::before_last_bar 47 53 */ 48 54 public function test_before_last_bar() { … … 54 60 /** 55 61 * @ticket 35950 62 * 63 * @covers ::get_available_languages 56 64 */ 57 65 public function test_get_available_languages() { … … 68 76 /** 69 77 * @ticket 35284 78 * 79 * @covers ::wp_get_installed_translations 70 80 */ 71 81 public function test_wp_get_installed_translations_for_core() { … … 90 100 /** 91 101 * @ticket 35294 102 * 103 * @covers ::wp_dropdown_languages 92 104 */ 93 105 public function test_wp_dropdown_languages() { … … 112 124 /** 113 125 * @ticket 38632 126 * 127 * @covers ::wp_dropdown_languages 114 128 */ 115 129 public function test_wp_dropdown_languages_site_default() { … … 136 150 /** 137 151 * @ticket 44494 152 * 153 * @covers ::wp_dropdown_languages 138 154 */ 139 155 public function test_wp_dropdown_languages_exclude_en_us() { … … 154 170 /** 155 171 * @ticket 38632 172 * 173 * @covers ::wp_dropdown_languages 156 174 */ 157 175 public function test_wp_dropdown_languages_en_US_selected() { … … 176 194 /** 177 195 * Add site default language to ja_JP in dropdown 196 * 197 * @covers ::wp_dropdown_languages 178 198 */ 179 199 public function test_wp_dropdown_languages_site_default_ja_JP() { … … 200 220 /** 201 221 * Select dropdown language from de_DE to ja_JP 222 * 223 * @covers ::wp_dropdown_languages 202 224 */ 203 225 public function test_wp_dropdown_languages_ja_JP_selected() { … … 247 269 /** 248 270 * @ticket 35284 271 * 272 * @covers ::wp_get_pomo_file_data 249 273 */ 250 274 public function test_wp_get_pomo_file_data() { … … 273 297 /** 274 298 * @ticket 44541 299 * 300 * @covers ::the_excerpt 275 301 */ 276 302 public function test_length_of_excerpt_should_be_counted_by_words() { … … 297 323 /** 298 324 * @ticket 44541 325 * 326 * @covers ::the_excerpt 299 327 */ 300 328 public function test_length_of_excerpt_should_be_counted_by_chars() { … … 321 349 /** 322 350 * @ticket 44541 351 * 352 * @covers ::the_excerpt 323 353 */ 324 354 public function test_length_of_excerpt_should_be_counted_by_chars_in_japanese() { … … 345 375 /** 346 376 * @ticket 44541 377 * 378 * @covers ::the_excerpt_rss 347 379 */ 348 380 public function test_length_of_excerpt_rss_should_be_counted_by_words() { … … 369 401 /** 370 402 * @ticket 44541 403 * 404 * @covers ::the_excerpt_rss 371 405 */ 372 406 public function test_length_of_excerpt_rss_should_be_counted_by_chars() { … … 394 428 /** 395 429 * @ticket 44541 430 * 431 * @covers ::wp_dashboard_recent_drafts 396 432 */ 397 433 public function test_length_of_draft_should_be_counted_by_words() { … … 418 454 /** 419 455 * @ticket 44541 456 * 457 * @covers ::wp_dashboard_recent_drafts 420 458 */ 421 459 public function test_length_of_draft_should_be_counted_by_chars() { … … 442 480 /** 443 481 * @ticket 44541 482 * 483 * @covers ::wp_dashboard_recent_drafts 444 484 */ 445 485 public function test_length_of_draft_should_be_counted_by_chars_in_japanese() { … … 466 506 /** 467 507 * @ticket 44541 508 * 509 * @covers ::get_comment_excerpt 468 510 */ 469 511 public function test_length_of_comment_excerpt_should_be_counted_by_words() { … … 484 526 /** 485 527 * @ticket 44541 528 * 529 * @covers ::get_comment_excerpt 486 530 */ 487 531 public function test_length_of_comment_excerpt_should_be_counted_by_chars() { … … 502 546 /** 503 547 * @ticket 44541 548 * 549 * @covers ::get_comment_excerpt 504 550 */ 505 551 public function test_length_of_comment_excerpt_should_be_counted_by_chars_in_Japanese() { -
trunk/tests/phpunit/tests/l10n/getLocale.php
r51415 r53866 4 4 * @group l10n 5 5 * @group i18n 6 * 7 * @covers ::get_locale 6 8 */ 7 9 class Tests_L10n_GetLocale extends WP_UnitTestCase { -
trunk/tests/phpunit/tests/l10n/getUserLocale.php
r51568 r53866 4 4 * @group l10n 5 5 * @group i18n 6 * 7 * @covers ::get_user_locale 6 8 */ 7 9 class Tests_L10n_GetUserLocale extends WP_UnitTestCase { -
trunk/tests/phpunit/tests/l10n/loadScriptTextdomain.php
r51657 r53866 4 4 * @group l10n 5 5 * @group i18n 6 * 7 * @covers ::load_script_textdomain 6 8 */ 7 9 class Tests_L10n_LoadScriptTextdomain extends WP_UnitTestCase { -
trunk/tests/phpunit/tests/l10n/loadTextdomain.php
r52010 r53866 33 33 } 34 34 35 /** 36 * @covers ::is_textdomain_loaded 37 */ 35 38 public function test_is_textdomain_loaded() { 36 39 $this->assertFalse( is_textdomain_loaded( 'wp-tests-domain' ) ); 37 40 } 38 41 42 /** 43 * @covers ::unload_textdomain 44 */ 39 45 public function test_unload_textdomain() { 40 46 $this->assertFalse( unload_textdomain( 'wp-tests-domain' ) ); 41 47 } 42 48 49 /** 50 * @covers ::unload_textdomain 51 */ 43 52 public function test_load_textdomain() { 44 53 $loaded = load_textdomain( 'wp-tests-domain', DIR_TESTDATA . '/pomo/simple.mo' ); … … 49 58 } 50 59 60 /** 61 * @covers ::unload_textdomain 62 */ 51 63 public function test_is_textdomain_loaded_after_loading() { 52 64 load_textdomain( 'wp-tests-domain', DIR_TESTDATA . '/pomo/simple.mo' ); … … 59 71 } 60 72 73 /** 74 * @covers ::unload_textdomain 75 */ 61 76 public function test_unload_textdomain_after_loading() { 62 77 load_textdomain( 'wp-tests-domain', DIR_TESTDATA . '/pomo/simple.mo' ); … … 65 80 } 66 81 82 /** 83 * @covers ::is_textdomain_loaded 84 */ 67 85 public function test_is_textdomain_loaded_after_unloading() { 68 86 load_textdomain( 'wp-tests-domain', DIR_TESTDATA . '/pomo/simple.mo' ); … … 75 93 /** 76 94 * @ticket 21319 95 * 96 * @covers ::load_textdomain 77 97 */ 78 98 public function test_load_textdomain_non_existent_file() { … … 82 102 /** 83 103 * @ticket 21319 104 * 105 * @covers ::is_textdomain_loaded 84 106 */ 85 107 public function test_is_textdomain_loaded_non_existent_file() { … … 91 113 /** 92 114 * @ticket 21319 115 * 116 * @covers ::get_translations_for_domain 93 117 */ 94 118 public function test_get_translations_for_domain_non_existent_file() { … … 100 124 /** 101 125 * @ticket 21319 126 * 127 * @covers ::unload_textdomain 102 128 */ 103 129 public function test_unload_textdomain_non_existent_file() { … … 109 135 /** 110 136 * @ticket 21319 137 * 138 * @covers ::is_textdomain_loaded 111 139 */ 112 140 public function test_is_textdomain_is_not_loaded_after_gettext_call_with_no_translations() { … … 116 144 } 117 145 146 /** 147 * @covers ::load_textdomain 148 */ 118 149 public function test_override_load_textdomain_noop() { 119 150 add_filter( 'override_load_textdomain', '__return_true' ); … … 125 156 } 126 157 158 /** 159 * @covers ::load_textdomain 160 */ 127 161 public function test_override_load_textdomain_non_existent_mofile() { 128 162 add_filter( 'override_load_textdomain', array( $this, 'override_load_textdomain_filter' ), 10, 3 ); … … 139 173 } 140 174 175 /** 176 * @covers ::load_textdomain 177 */ 141 178 public function test_override_load_textdomain_custom_mofile() { 142 179 add_filter( 'override_load_textdomain', array( $this, 'override_load_textdomain_filter' ), 10, 3 ); … … 181 218 } 182 219 220 /** 221 * @covers ::load_muplugin_textdomain 222 */ 183 223 public function test_load_muplugin_textdomain_site_locale() { 184 224 load_muplugin_textdomain( 'wp-tests-domain' ); … … 189 229 /** 190 230 * @ticket 38485 231 * 232 * @covers ::load_muplugin_textdomain 191 233 */ 192 234 public function test_load_muplugin_textdomain_user_locale() { … … 199 241 } 200 242 243 /** 244 * @covers ::load_plugin_textdomain 245 */ 201 246 public function test_load_plugin_textdomain_site_locale() { 202 247 load_plugin_textdomain( 'wp-tests-domain' ); … … 207 252 /** 208 253 * @ticket 38485 254 * 255 * @covers ::load_plugin_textdomain 209 256 */ 210 257 public function test_load_plugin_textdomain_user_locale() { … … 217 264 } 218 265 266 /** 267 * @covers ::load_theme_textdomain 268 */ 219 269 public function test_load_theme_textdomain_site_locale() { 220 270 load_theme_textdomain( 'wp-tests-domain' ); … … 225 275 /** 226 276 * @ticket 38485 277 * 278 * @covers ::load_theme_textdomain 227 279 */ 228 280 public function test_load_theme_textdomain_user_locale() { -
trunk/tests/phpunit/tests/l10n/loadTextdomainJustInTime.php
r52248 r53866 63 63 /** 64 64 * @ticket 34114 65 * 66 * @covers ::is_textdomain_loaded 65 67 */ 66 68 public function test_plugin_translation_should_be_translated_without_calling_load_plugin_textdomain() { … … 82 84 /** 83 85 * @ticket 34114 86 * 87 * @covers ::is_textdomain_loaded 84 88 */ 85 89 public function test_theme_translation_should_be_translated_without_calling_load_theme_textdomain() { … … 103 107 /** 104 108 * @ticket 34114 109 * 110 * @covers ::get_translations_for_domain 105 111 */ 106 112 public function test_get_translations_for_domain_does_not_return_null_if_override_load_textdomain_is_used() { … … 116 122 /** 117 123 * @ticket 37113 124 * 125 * @covers ::is_textdomain_loaded 118 126 */ 119 127 public function test_should_allow_unloading_of_text_domain() { … … 155 163 /** 156 164 * @ticket 26511 165 * 166 * @covers ::switch_to_locale 157 167 */ 158 168 public function test_plugin_translation_after_switching_locale() { … … 168 178 /** 169 179 * @ticket 37997 180 * 181 * @covers ::switch_to_locale 170 182 */ 171 183 public function test_plugin_translation_after_switching_locale_twice() { … … 186 198 /** 187 199 * @ticket 26511 200 * 201 * @covers ::switch_to_locale 188 202 */ 189 203 public function test_theme_translation_after_switching_locale() { … … 203 217 /** 204 218 * @ticket 38485 219 * 220 * @covers ::wp_set_current_user 205 221 */ 206 222 public function test_plugin_translation_with_user_locale() { … … 217 233 /** 218 234 * @ticket 38485 235 * 236 * @covers ::wp_set_current_user 219 237 */ 220 238 public function test_theme_translation_with_user_locale() { … … 234 252 /** 235 253 * @ticket 37997 254 * 255 * @covers ::_load_textdomain_just_in_time 236 256 */ 237 257 public function test_get_locale_is_called_only_once_per_textdomain() { -
trunk/tests/phpunit/tests/l10n/translateSettingsUsingI18nSchema.php
r52010 r53866 4 4 * @group l10n 5 5 * @group i18n 6 * 7 * @covers ::translate_settings_using_i18n_schema 6 8 */ 7 9 class Tests_L10n_TranslateSettingsUsingI18nSchema extends WP_UnitTestCase { -
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; -
trunk/tests/phpunit/tests/locale.php
r51568 r53866 16 16 } 17 17 18 /** 19 * @covers WP_Locale::get_weekday 20 */ 18 21 public function test_get_weekday() { 19 22 $this->assertSame( __( 'Sunday' ), $this->locale->get_weekday( 0 ) ); … … 26 29 } 27 30 31 /** 32 * @covers WP_Locale::get_weekday 33 */ 28 34 public function test_get_weekday_undefined_index() { 29 35 if ( PHP_VERSION_ID >= 80000 ) { … … 36 42 } 37 43 44 /** 45 * @covers WP_Locale::get_weekday_initial 46 */ 38 47 public function test_get_weekday_initial() { 39 48 $this->assertSame( __( 'S' ), $this->locale->get_weekday_initial( __( 'Sunday' ) ) ); … … 46 55 } 47 56 57 /** 58 * @covers WP_Locale::get_weekday_abbrev 59 */ 48 60 public function test_get_weekday_abbrev() { 49 61 $this->assertSame( __( 'Sun' ), $this->locale->get_weekday_abbrev( __( 'Sunday' ) ) ); … … 56 68 } 57 69 70 /** 71 * @covers WP_Locale::get_month 72 */ 58 73 public function test_get_month() { 59 74 $this->assertSame( __( 'January' ), $this->locale->get_month( 1 ) ); … … 71 86 } 72 87 88 /** 89 * @covers WP_Locale::get_month 90 */ 73 91 public function test_get_month_leading_zero() { 74 92 $this->assertSame( __( 'January' ), $this->locale->get_month( '01' ) ); … … 83 101 } 84 102 103 /** 104 * @covers WP_Locale::get_month_abbrev 105 */ 85 106 public function test_get_month_abbrev() { 86 107 $this->assertSame( __( 'Jan' ), $this->locale->get_month_abbrev( __( 'January' ) ) ); … … 98 119 } 99 120 121 /** 122 * @covers WP_Locale::get_meridiem 123 */ 100 124 public function test_get_meridiem() { 101 125 $this->assertSame( __( 'am' ), $this->locale->get_meridiem( 'am' ) ); … … 105 129 } 106 130 131 /** 132 * @covers WP_Locale::is_rtl 133 */ 107 134 public function test_is_rtl() { 108 135 $this->assertFalse( $this->locale->is_rtl() );
Note: See TracChangeset
for help on using the changeset viewer.