diff --git a/tests/php/validation/test-class-amp-validation-manager.php b/tests/php/validation/test-class-amp-validation-manager.php index 6178dc22e24..6b34000c130 100644 --- a/tests/php/validation/test-class-amp-validation-manager.php +++ b/tests/php/validation/test-class-amp-validation-manager.php @@ -1382,6 +1382,9 @@ public function test_add_block_source_comments( $content, $expected, $query ) { $rendered_block = do_blocks( AMP_Validation_Manager::add_block_source_comments( $content ) ); + // Remove class name injected by gutenberg_render_layout_support_flag(). + $rendered_block = preg_replace( '/(?<= class=")wp-container-\w+ /', '', $rendered_block ); + $expected = str_replace( [ '{{post_id}}',