Changeset 51599 for trunk/tests/phpunit/tests/blocks/register.php
- Timestamp:
- 08/11/2021 09:06:31 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/blocks/register.php
r51568 r51599 68 68 69 69 parent::tear_down(); 70 } 71 72 /** 73 * Returns Polish locale string. 74 * 75 * @return string 76 */ 77 function filter_set_locale_to_polish() { 78 return 'pl_PL'; 70 79 } 71 80 … … 373 382 $this->assertSame( 374 383 array( 384 array( 385 'name' => 'error', 386 'title' => 'Error', 387 'description' => 'Shows error.', 388 'keywords' => array( 'failure' ), 389 ), 390 ), 391 $result->variations 392 ); 393 $this->assertSame( 394 array( 375 395 'attributes' => array( 376 396 'message' => 'This is a notice!', … … 408 428 */ 409 429 function test_block_registers_with_metadata_i18n_support() { 410 function filter_set_locale_to_polish() { 411 return 'pl_PL'; 412 } 413 add_filter( 'locale', 'filter_set_locale_to_polish' ); 430 add_filter( 'locale', array( $this, 'filter_set_locale_to_polish' ) ); 414 431 load_textdomain( 'notice', WP_LANG_DIR . '/plugins/notice-pl_PL.mo' ); 415 432 … … 419 436 420 437 unload_textdomain( 'notice' ); 421 remove_filter( 'locale', 'filter_set_locale_to_polish');438 remove_filter( 'locale', array( $this, 'filter_set_locale_to_polish' ) ); 422 439 423 440 $this->assertInstanceOf( 'WP_Block_Type', $result ); … … 440 457 $result->styles 441 458 ); 459 $this->assertSame( 460 array( 461 array( 462 'name' => 'error', 463 'title' => 'Błąd', 464 'description' => 'Wyświetla błąd.', 465 'keywords' => array( 'niepowodzenie' ), 466 ), 467 ), 468 $result->variations 469 ); 442 470 } 443 471
Note: See TracChangeset
for help on using the changeset viewer.