Changeset 57344
- Timestamp:
- 01/24/2024 07:55:53 AM (13 months ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-textdomain-registry.php
r57303 r57344 226 226 * } 227 227 * } 228 * @return void229 228 */ 230 229 public function invalidate_mo_files_cache( $upgrader, $hook_extra ) { -
trunk/src/wp-includes/l10n/class-wp-translation-file.php
r57337 r57344 285 285 abstract protected function parse_file(); 286 286 287 288 287 /** 289 288 * Exports translation contents as a string. -
trunk/src/wp-includes/l10n/class-wp-translations.php
r57337 r57344 81 81 * @since 6.5.0 82 82 * 83 * @param string $original Original string to translate from MO file. Might contain84 * 0x04 as context separator or 0x00 as singular/plural separator.83 * @param string $original Original string to translate from MO file. Might contain 84 * 0x04 as context separator or 0x00 as singular/plural separator. 85 85 * @param string $translations Translation strings from MO file. 86 86 * @return Translation_Entry Entry instance. -
trunk/tests/phpunit/tests/l10n/wpTranslationController.php
r57339 r57344 6 6 */ 7 7 class WP_Translation_Controller_Tests extends WP_UnitTestCase { 8 /**9 * @return void10 */11 8 public function tear_down() { 12 9 remove_all_filters( 'translation_file_format' ); … … 22 19 * @covers WP_Translation_Controller::get_headers 23 20 * @covers WP_Translation_Controller::normalize_header 24 *25 * @return void26 21 */ 27 22 public function test_load_textdomain() { … … 74 69 * @covers WP_Translation_Controller::get_headers 75 70 * @covers WP_Translation_Controller::normalize_header 76 *77 * @return void78 71 */ 79 72 public function test_load_textdomain_existing_override() { … … 94 87 /** 95 88 * @covers ::load_textdomain 96 *97 * @return void98 89 */ 99 90 public function test_load_textdomain_php_files() { … … 108 99 /** 109 100 * @covers ::load_textdomain 110 *111 * @return void112 101 */ 113 102 public function test_load_textdomain_prefers_php_files_by_default() { … … 132 121 /** 133 122 * @covers ::load_textdomain 134 *135 * @return void136 123 */ 137 124 public function test_load_textdomain_reads_php_files_if_filtered_format_is_unsupported() { … … 159 146 /** 160 147 * @covers ::load_textdomain 161 *162 * @return void163 148 */ 164 149 public function test_load_textdomain_existing_translation_is_kept() { … … 184 169 /** 185 170 * @covers ::load_textdomain 186 *187 * @return void188 171 */ 189 172 public function test_load_textdomain_loads_existing_translation() { … … 206 189 /** 207 190 * @covers ::load_textdomain 208 *209 * @return void210 191 */ 211 192 public function test_load_textdomain_loads_existing_translation_mo_files() { … … 237 218 /** 238 219 * @covers ::load_textdomain 239 *240 * @return void241 220 */ 242 221 public function test_load_textdomain_loads_existing_translation_php_files() { … … 269 248 * @covers WP_Translation_Controller::get_headers 270 249 * @covers WP_Translation_Controller::normalize_header 271 *272 * @return void273 250 */ 274 251 public function test_unload_textdomain() { … … 297 274 /** 298 275 * @covers ::unload_textdomain 299 *300 * @return void301 276 */ 302 277 public function test_unload_textdomain_existing_override() { … … 324 299 * @covers ::unload_file 325 300 * @covers ::unload_textdomain 326 *327 * @return void328 301 */ 329 302 public function test_unload_non_existent_files_and_textdomains() { … … 339 312 * @covers ::load_textdomain 340 313 * @covers ::unload_textdomain 341 *342 * @return void343 314 */ 344 315 public function test_switch_to_locale_translations_stay_loaded_default_textdomain() { … … 364 335 * @covers ::unload_textdomain 365 336 * @covers ::change_locale 366 *367 * @return void368 337 */ 369 338 public function test_switch_to_locale_translations_stay_loaded_custom_textdomain() { -
trunk/tests/phpunit/tests/l10n/wpTranslations.php
r57337 r57344 7 7 */ 8 8 class WP_Translations_Tests extends WP_UnitTestCase { 9 /**10 * @return void11 */12 9 public function tear_down() { 13 10 unload_textdomain( 'wp-tests-domain' ); … … 20 17 * @covers ::__get 21 18 * @covers ::make_entry 22 *23 * @return void24 19 */ 25 20 public function test_get_entries() { … … 59 54 * @covers ::__get 60 55 * @covers ::make_entry 61 *62 * @return void63 56 */ 64 57 public function test_get_entries_plural() { … … 100 93 * @covers ::__get 101 94 * @covers ::make_entry 102 *103 * @return void104 95 */ 105 96 public function test_get_entries_context() { … … 146 137 /** 147 138 * @covers ::__get 148 *149 * @return void150 139 */ 151 140 public function test_get_headers() { … … 175 164 /** 176 165 * @covers ::__get 177 *178 * @return void179 166 */ 180 167 public function test_getter_unsupported_property() { … … 192 179 /** 193 180 * @covers ::translate 194 *195 * @return void196 181 */ 197 182 public function test_translate() { … … 215 200 /** 216 201 * @covers ::translate_plural 217 *218 * @return void219 202 */ 220 203 public function test_translate_plural() { … … 240 223 /** 241 224 * @covers ::translate_plural 242 *243 * @return void244 225 */ 245 226 public function test_translate_plural_missing() { … … 266 247 * 267 248 * @ticket 41257 268 *269 * @return void270 249 */ 271 250 public function test_translate_invalid_edge_cases() { -
trunk/tests/phpunit/tests/l10n/wpTranslationsConvert.php
r57339 r57344 9 9 /** 10 10 * @covers ::instance 11 *12 * @return void13 11 */ 14 12 public function test_get_instance() { … … 19 17 } 20 18 21 /**22 * @return void23 */24 19 public function test_no_files_loaded_returns_false() { 25 20 $instance = new WP_Translation_Controller(); … … 30 25 /** 31 26 * @covers ::unload_textdomain 32 *33 * @return void34 27 */ 35 28 public function test_unload_not_loaded() { … … 46 39 * @covers ::locate_translation 47 40 * @covers ::get_files 48 *49 * @return void50 41 */ 51 42 public function test_unload_entire_textdomain() { … … 65 56 * @covers ::unload_file 66 57 * @covers WP_Translation_File::get_file 67 *68 * @return void69 58 */ 70 59 public function test_unload_file_is_not_actually_loaded() { … … 80 69 * @covers ::unload_textdomain 81 70 * @covers ::is_textdomain_loaded 82 *83 * @return void84 71 */ 85 72 public function test_unload_specific_locale() { … … 112 99 * @param string $file_contents 113 100 * @param string|bool $expected_error 114 * @return void115 *116 * @phpstan-param 'mo'|'php' $type117 101 */ 118 102 public function test_invalid_files( string $type, string $file_contents, $expected_error = null ) { … … 158 142 * @covers WP_Translation_Controller::load 159 143 * @covers WP_Translation_Controller::is_textdomain_loaded 160 *161 * @return void162 144 */ 163 145 public function test_load_non_existent_file() { … … 170 152 /** 171 153 * @covers WP_Translation_File::create 172 *173 * @return void174 154 */ 175 155 public function test_create_non_existent_file() { … … 179 159 /** 180 160 * @covers WP_Translation_File::create 181 *182 * @return void183 161 */ 184 162 public function test_create_invalid_filetype() { … … 200 178 * 201 179 * @param string $file 202 * @return void203 180 */ 204 181 public function test_simple_translation_files( string $file ) { … … 244 221 * @covers WP_Translation_File::get_plural_form 245 222 * @covers WP_Translation_File::make_plural_form_function 246 *247 * @return void248 223 */ 249 224 public function test_load_multiple_files() { … … 294 269 * @covers ::translate 295 270 * @covers ::translate_plural 296 *297 * @return void298 271 */ 299 272 public function test_load_multiple_locales() { … … 335 308 /** 336 309 * @covers ::unload_textdomain 337 *338 * @return void339 310 */ 340 311 public function test_unload_with_multiple_locales() { … … 372 343 * @covers ::load 373 344 * @covers ::locate_translation 374 *375 * @return void376 345 */ 377 346 public function test_load_with_default_textdomain() { … … 385 354 /** 386 355 * @covers ::load 387 *388 * @return void389 356 */ 390 357 public function test_load_same_file_twice() { … … 398 365 /** 399 366 * @covers ::load 400 *401 * @return void402 367 */ 403 368 public function test_load_file_is_already_loaded_for_different_textdomain() { … … 419 384 * @covers WP_Translation_File::get_plural_form 420 385 * @covers WP_Translation_File::make_plural_form_function 421 *422 * @return void423 386 */ 424 387 public function test_load_no_plurals() { … … 440 403 /** 441 404 * @covers ::get_headers 442 *443 * @return void444 405 */ 445 406 public function test_get_headers_no_loaded_translations() { … … 451 412 /** 452 413 * @covers ::get_headers 453 *454 * @return void455 414 */ 456 415 public function test_get_headers_with_default_textdomain() { … … 468 427 /** 469 428 * @covers ::get_headers 470 *471 * @return void472 429 */ 473 430 public function test_get_headers_no_loaded_translations_for_domain() { … … 481 438 /** 482 439 * @covers ::get_entries 483 *484 * @return void485 440 */ 486 441 public function test_get_entries_no_loaded_translations() { … … 492 447 /** 493 448 * @covers ::get_entries 494 *495 * @return void496 449 */ 497 450 public function test_get_entries_with_default_textdomain() { … … 510 463 /** 511 464 * @covers ::get_entries 512 *513 * @return void514 465 */ 515 466 public function test_get_entries_no_loaded_translations_for_domain() { … … 525 476 * @param string $source_file 526 477 * @param string $destination_format 527 * @return void528 *529 * @phpstan-param 'mo'|'php' $destination_format530 478 */ 531 479 public function test_convert_format( string $source_file, string $destination_format ) { … … 587 535 /** 588 536 * @covers WP_Translation_File::transform 589 *590 * @return void591 537 */ 592 538 public function test_convert_format_invalid_source() {
Note: See TracChangeset
for help on using the changeset viewer.