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 ); 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 );