diff --git a/tests/phpunit/tests/general/template.php b/tests/phpunit/tests/general/template.php
index 46a6842251..5b987c872d 100644
--- a/tests/phpunit/tests/general/template.php
+++ b/tests/phpunit/tests/general/template.php
@@ -244,10 +244,14 @@ class Tests_General_Template extends WP_UnitTestCase {
the_custom_logo();
$this->_set_custom_logo();
- $size = get_theme_support( 'custom-logo', 'size' );
- $expected = sprintf( '
', $this->custom_logo_url, $size, basename( $this->custom_logo_url ) );
+ $size = get_theme_support( 'custom-logo', 'size' );
+ $image = wp_get_attachment_image( $this->custom_logo_id, $size, false, array(
+ 'class' => "custom-logo attachment-$size",
+ 'data-size' => $size,
+ 'itemprop' => 'logo',
+ ) );
- $this->expectOutputString( $expected );
+ $this->expectOutputString( '' . $image . '' );
the_custom_logo();
}