diff --git a/tests/phpunit/tests/media.php b/tests/phpunit/tests/media.php index 85e9760..90b7003 100644 --- a/tests/phpunit/tests/media.php +++ b/tests/phpunit/tests/media.php @@ -46,7 +46,7 @@ function test_wp_lazy_load_content_media() {

Image, with pre-existing "loading" attribute.

%5$s -

Iframe, standard. Should not be modified by default.

+

Iframe, standard. Should not be modified.

%4$s'; $content_unfiltered = sprintf( $content, $img, $img_xhtml, $img_html5, $iframe, $img_eager ); @@ -59,21 +59,16 @@ function test_wp_lazy_load_content_media() { * @ticket 44427 */ function test_wp_lazy_load_content_media_opted_in() { - $img = get_image_tag( self::$large_id, '', '', '', 'medium' ); - $iframe = ''; + $img = get_image_tag( self::$large_id, '', '', '', 'medium' ); - $lazy_img = str_replace( ']+>/', + '/]+>/', function( array $matches ) { if ( ! preg_match( '/\sloading\s*=/', $matches[0] ) ) { - $tag = $matches[1]; - $space = $matches[2]; - - return str_replace( '<' . $tag . $space, '<' . $tag . $space . 'loading="lazy" ', $matches[0] ); + return str_replace( '