Changeset 53091 for trunk/tests/phpunit/tests/blocks/register.php
- Timestamp:
- 04/07/2022 11:57:16 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/blocks/register.php
r52699 r53091 254 254 255 255 /** 256 * @ticket 55513 257 */ 258 public function test_success_register_block_script_handle_in_theme() { 259 switch_theme( 'block-theme' ); 260 261 $metadata = array( 262 'file' => wp_normalize_path( get_theme_file_path( 'blocks/example-block/block.json' ) ), 263 'name' => 'block-theme/example-block', 264 'viewScript' => 'file:./view.js', 265 ); 266 $result = register_block_script_handle( $metadata, 'viewScript' ); 267 268 $expected_script_handle = 'block-theme-example-block-view-script'; 269 $this->assertSame( $expected_script_handle, $result ); 270 } 271 272 /** 256 273 * @ticket 50263 257 274 */ … … 304 321 wp_normalize_path( wp_styles()->get_data( 'unit-tests-test-block-style', 'path' ) ) 305 322 ); 323 } 324 325 /** 326 * @ticket 55513 327 */ 328 public function test_success_register_block_style_handle_in_theme() { 329 switch_theme( 'block-theme' ); 330 331 $metadata = array( 332 'file' => wp_normalize_path( get_theme_file_path( 'blocks/example-block/block.json' ) ), 333 'name' => 'block-theme/example-block', 334 'editorStyle' => 'file:./editor-style.css', 335 ); 336 $result = register_block_style_handle( $metadata, 'editorStyle' ); 337 338 $expected_style_handle = 'block-theme-example-block-editor-style'; 339 $this->assertSame( $expected_style_handle, $result ); 340 $this->assertSame( 'replace', wp_styles()->get_data( $expected_style_handle, 'rtl' ) ); 306 341 } 307 342
Note: See TracChangeset
for help on using the changeset viewer.