Skip to content

Commit

Permalink
Split and expand core block handle module tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sirreal committed Feb 5, 2024
1 parent 8789667 commit b2552f6
Showing 1 changed file with 38 additions and 5 deletions.
43 changes: 38 additions & 5 deletions tests/phpunit/tests/blocks/register.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,6 @@ public function test_generate_block_asset_handle() {

/**
* @ticket 50328
* @ticket 60233
*/
public function test_generate_block_asset_handle_core_block() {
$block_name = 'core/paragraph';
Expand All @@ -196,6 +195,35 @@ public function test_generate_block_asset_handle_core_block() {
'wp-block-paragraph-view-100',
generate_block_asset_handle( $block_name, 'viewScript', 99 )
);
$this->assertSame(
'wp-block-paragraph-editor-2',
generate_block_asset_handle( $block_name, 'editorStyle', 1 )
);
$this->assertSame(
'wp-block-paragraph',
generate_block_asset_handle( $block_name, 'style' )
);
}

/**
* @ticket 60233
*/
public function test_generate_block_asset_handle_core_block_module() {
$block_name = 'core/paragraph';

$this->assertSame(
'wp-block-paragraph-editor-script-module',
generate_block_asset_handle( $block_name, 'editorScriptModule' )
);
$this->assertSame(
'wp-block-paragraph-editor-script-module-2',
generate_block_asset_handle( $block_name, 'editorScriptModule', 1 )
);
$this->assertSame(
'wp-block-paragraph-editor-script-module-100',
generate_block_asset_handle( $block_name, 'editorScriptModule', 99 )
);

$this->assertSame(
'wp-block-paragraph-view-script-module',
generate_block_asset_handle( $block_name, 'viewScriptModule' )
Expand All @@ -208,13 +236,18 @@ public function test_generate_block_asset_handle_core_block() {
'wp-block-paragraph-view-script-module-100',
generate_block_asset_handle( $block_name, 'viewScriptModule', 99 )
);

$this->assertSame(
'wp-block-paragraph-editor-2',
generate_block_asset_handle( $block_name, 'editorStyle', 1 )
'wp-block-paragraph-script-module',
generate_block_asset_handle( $block_name, 'scriptModule' )
);
$this->assertSame(
'wp-block-paragraph',
generate_block_asset_handle( $block_name, 'style' )
'wp-block-paragraph-script-module-2',
generate_block_asset_handle( $block_name, 'scriptModule', 1 )
);
$this->assertSame(
'wp-block-paragraph-script-module-100',
generate_block_asset_handle( $block_name, 'scriptModule', 99 )
);
}

Expand Down

0 comments on commit b2552f6

Please sign in to comment.