From 296c233b085e3e97e213ca7959532837591cc030 Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Thu, 22 Aug 2024 10:34:27 -0700 Subject: [PATCH] Account for CSS changes in twentyten theme --- tests/php/test-amp-style-sanitizer.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/php/test-amp-style-sanitizer.php b/tests/php/test-amp-style-sanitizer.php index b2ee1a986e3..7142e5a8503 100644 --- a/tests/php/test-amp-style-sanitizer.php +++ b/tests/php/test-amp-style-sanitizer.php @@ -3524,11 +3524,11 @@ function ( $original_dom, $original_source, $amphtml_dom, $amphtml_source ) { $this->assertStringContainsString( '.wp-block-audio figcaption', $amphtml_source, 'Expected block-library/style.css' ); } - if ( version_compare( strtok( get_bloginfo( 'version' ), '-' ), '6.6', '>=' ) ) { - $this->assertStringContainsString( '[class^="wp-block-"]:not(.wp-block-gallery) > figcaption', $amphtml_source, 'Expected twentyten/blocks.css' ); - } else { - $this->assertStringContainsString( '[class^="wp-block-"]:not(.wp-block-gallery) figcaption', $amphtml_source, 'Expected twentyten/blocks.css' ); - } + $this->assertStringContainsString( + '[class^="wp-block-"]:not(.wp-block-gallery) figcaption', + str_replace( '> figcaption', 'figcaption', $amphtml_source ), // Account for recent CSS changes. + 'Expected twentyten/blocks.css' + ); $amphtml_source = preg_replace( '/\s*>\s*/', '>', $amphtml_source ); // Account for variance in postcss. $this->assertStringContainsString( '.amp-wp-default-form-message>p', $amphtml_source, 'Expected amp-default.css' );