Skip to content

Commit 7e234f0

Browse files
committed
Remove unnecessary unit test
1 parent ae50bcc commit 7e234f0

File tree

1 file changed

+0
-67
lines changed

1 file changed

+0
-67
lines changed

tests/phpunit/tests/block-supports/layout.php

Lines changed: 0 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -717,71 +717,4 @@ public function data_layout_classname_with_custom_blocks() {
717717
),
718718
);
719719
}
720-
721-
/**
722-
* Tests that core blocks maintain correct layout classnames (regression test).
723-
*
724-
* This test ensures that the fix for custom block layout classnames
725-
* doesn't break the existing behavior for core blocks.
726-
*
727-
* @ticket 63839
728-
* @covers ::wp_render_layout_support_flag
729-
*
730-
* @dataProvider data_layout_classname_with_core_blocks
731-
*/
732-
public function test_layout_classname_works_for_core_blocks( $block_name, $layout_type, $expected_class, $should_not_contain ) {
733-
switch_theme( 'default' );
734-
735-
$block_content = '<div class="wp-block-test"><p>Content</p></div>';
736-
$block = array(
737-
'blockName' => $block_name,
738-
'attrs' => array(
739-
'layout' => array(
740-
'type' => $layout_type,
741-
),
742-
),
743-
);
744-
745-
$output = wp_render_layout_support_flag( $block_content, $block );
746-
747-
// Assert that core blocks use only the block name without namespace.
748-
$this->assertStringContainsString( $expected_class, $output );
749-
750-
// Assert that core blocks don't include the 'core' namespace prefix.
751-
$this->assertStringNotContainsString( $should_not_contain, $output );
752-
}
753-
754-
/**
755-
* Data provider for test_layout_classname_works_for_core_blocks.
756-
*
757-
* @return array
758-
*/
759-
public function data_layout_classname_with_core_blocks() {
760-
return array(
761-
'core group block with constrained layout' => array(
762-
'block_name' => 'core/group',
763-
'layout_type' => 'constrained',
764-
'expected_class' => 'wp-block-group-is-layout-constrained',
765-
'should_not_contain' => 'wp-block-core-group-is-layout-constrained',
766-
),
767-
'core cover block with default layout' => array(
768-
'block_name' => 'core/cover',
769-
'layout_type' => 'default',
770-
'expected_class' => 'wp-block-cover-is-layout-flow',
771-
'should_not_contain' => 'wp-block-core-cover-is-layout-flow',
772-
),
773-
'core columns block with flex layout' => array(
774-
'block_name' => 'core/columns',
775-
'layout_type' => 'flex',
776-
'expected_class' => 'wp-block-columns-is-layout-flex',
777-
'should_not_contain' => 'wp-block-core-columns-is-layout-flex',
778-
),
779-
'core group block with grid layout' => array(
780-
'block_name' => 'core/group',
781-
'layout_type' => 'grid',
782-
'expected_class' => 'wp-block-group-is-layout-grid',
783-
'should_not_contain' => 'wp-block-core-group-is-layout-grid',
784-
),
785-
);
786-
}
787720
}

0 commit comments

Comments
 (0)