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 Jan 31, 2024
1 parent e4a24a2 commit b8eec7c
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 b8eec7c

Please sign in to comment.