diff --git a/tests/phpunit/tests/blocks/register.php b/tests/phpunit/tests/blocks/register.php
index ca906086a3..7a86d22a44 100644
a
|
b
|
class Tests_Blocks_Register extends WP_UnitTestCase { |
372 | 372 | wp_normalize_path( realpath( DIR_TESTDATA . '/blocks/notice/block.css' ) ), |
373 | 373 | wp_normalize_path( wp_styles()->get_data( 'unit-tests-test-block-style', 'path' ) ) |
374 | 374 | ); |
| 375 | |
| 376 | } |
| 377 | |
| 378 | /** |
| 379 | * @ticket 56797 |
| 380 | */ |
| 381 | public function test_success_register_block_style_handle_rtl() { |
| 382 | |
| 383 | global $wp_locale; |
| 384 | $orig_text_dir = $wp_locale->text_direction; |
| 385 | |
| 386 | $wp_locale->text_direction = 'rtl'; |
| 387 | |
| 388 | $metadata = array( |
| 389 | 'file' => DIR_TESTDATA . '/blocks/notice/block.json', |
| 390 | 'name' => 'unit-tests/test-block-rtl', |
| 391 | 'style' => 'file:./block.css', |
| 392 | ); |
| 393 | $result = register_block_style_handle( $metadata, 'style' ); |
| 394 | |
| 395 | $this->assertSame( 'unit-tests-test-block-rtl-style', $result ); |
| 396 | $this->assertSame( 'replace', wp_styles()->get_data( 'unit-tests-test-block-rtl-style', 'rtl' ) ); |
| 397 | $this->assertSame( '', wp_styles()->get_data( 'unit-tests-test-block-rtl-style', 'suffix' ) ); |
| 398 | $this->assertSame( |
| 399 | wp_normalize_path( realpath( DIR_TESTDATA . '/blocks/notice/block-rtl.css' ) ), |
| 400 | wp_normalize_path( wp_styles()->get_data( 'unit-tests-test-block-rtl-style', 'path' ) ) |
| 401 | ); |
| 402 | |
| 403 | $wp_locale->text_direction = $orig_text_dir; |
| 404 | |
375 | 405 | } |
376 | 406 | |
377 | 407 | /** |