Skip to content

Commit

Permalink
Remove test blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
tellthemachines committed Jun 12, 2024
1 parent d28ea58 commit 0077769
Showing 1 changed file with 0 additions and 85 deletions.
85 changes: 0 additions & 85 deletions phpunit/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,91 +101,6 @@ function fail_if_died( $message ) {
// Enable the widget block editor.
tests_add_filter( 'gutenberg_use_widgets_block_editor', '__return_true' );

/**
* Register test block prior to theme.json generating metadata.
*
* This new block is used to test experimental selectors. It is registered
* via `tests_add_filter()` here during bootstrapping so that it occurs prior
* to theme.json generating block metadata. Once a core block, such as Image,
* uses feature level selectors we could remove this in favour of testing via
* the core block.
*/
function gutenberg_register_test_block_for_feature_selectors() {
WP_Block_Type_Registry::get_instance()->register(
'test/test',
array(
'api_version' => 3,
'attributes' => array(
'textColor' => array(
'type' => 'string',
),
'style' => array(
'type' => 'object',
),
),
'supports' => array(
'__experimentalBorder' => array(
'radius' => true,
'__experimentalSelector' => '.inner',
),
'color' => array(
'text' => true,
),
'spacing' => array(
'padding' => true,
'__experimentalSelector' => '.inner',
),
'typography' => array(
'fontSize' => true,
'__experimentalSelector' => '.sub-heading',
),
'__experimentalSelector' => '.wp-block-test, .wp-block-test__wrapper',
),
)
);

WP_Block_Type_Registry::get_instance()->register(
'my/block-with-selectors',
array(
'api_version' => 2,
'attributes' => array(
'textColor' => array(
'type' => 'string',
),
'style' => array(
'type' => 'object',
),
),
'supports' => array(
'__experimentalBorder' => array(
'radius' => true,
),
'color' => array(
'background' => true,
'text' => true,
),
'spacing' => array(
'padding' => true,
),
'typography' => array(
'fontSize' => true,
),
),
'selectors' => array(
'root' => '.custom-root-selector',
'border' => array(
'root' => '.custom-root-selector img',
),
'color' => array(
'text' => '.custom-root-selector > figcaption',
),
'typography' => '.custom-root-selector > figcaption',
),
)
);
}
tests_add_filter( 'init', 'gutenberg_register_test_block_for_feature_selectors' );

// Start up the WP testing environment.
require $_tests_dir . '/includes/bootstrap.php';

Expand Down

0 comments on commit 0077769

Please sign in to comment.