From f01da9b5005d3fe9898d9743758b288d1f21819b Mon Sep 17 00:00:00 2001 From: thelovekesh Date: Wed, 22 Mar 2023 23:34:15 +0530 Subject: [PATCH 1/2] Fix test cases in `Test_AMP_Core_Block_Handler::class` after Gutenberg 15.4.0 release --- tests/php/test-class-amp-core-block-handler.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/php/test-class-amp-core-block-handler.php b/tests/php/test-class-amp-core-block-handler.php index 63c5591ac5f..c54cff6bc4d 100644 --- a/tests/php/test-class-amp-core-block-handler.php +++ b/tests/php/test-class-amp-core-block-handler.php @@ -351,6 +351,9 @@ public function test_ampify_gallery_block( $original_block_content, $expected_bl $expected = preg_replace( '/ data-id="\d+"/', '', $expected ); $actual = preg_replace( '/ data-id="\d+"/', '', $actual ); + // Remove `wp-block-gallery-is-layout-flex` class name injected by block editor layout styles. + $actual = preg_replace( '/\s*(?<= class=")?wp-block-gallery-is-layout-flex\s*/', '', $actual ); + // Remove `is-layout-flex` class name injected by block editor layout styles. $actual = preg_replace( '/\s*(?<= class=")?is-layout-flex\s*/', '', $actual ); From 12bbe87cb9bc7a9bcdebd450a5fba4665196b362 Mon Sep 17 00:00:00 2001 From: thelovekesh Date: Wed, 22 Mar 2023 23:42:14 +0530 Subject: [PATCH 2/2] Fix test cases in `Test_AMP_Validation_Manager::class` after Gutenberg 15.4.0 release --- tests/php/validation/test-class-amp-validation-manager.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/php/validation/test-class-amp-validation-manager.php b/tests/php/validation/test-class-amp-validation-manager.php index aefa17489bd..97bdd2c875b 100644 --- a/tests/php/validation/test-class-amp-validation-manager.php +++ b/tests/php/validation/test-class-amp-validation-manager.php @@ -1393,6 +1393,9 @@ public function test_add_block_source_comments( $content, $expected, $query ) { $rendered_block = do_blocks( AMP_Validation_Manager::add_block_source_comments( $content ) ); + // Remove `wp-block-columns-is-layout-flex` class name injected by block editor layout styles. + $rendered_block = preg_replace( '/\s*(?<= class=")?wp-block-columns-is-layout-flex\s*/', '', $rendered_block ); + // Remove `is-layout-flex` class name injected by block editor layout styles. $rendered_block = preg_replace( '/\s*(?<= class=")?is-layout-flex\s*/', '', $rendered_block );