Index: src/wp-includes/post-template.php
===================================================================
--- src/wp-includes/post-template.php	(revision 41157)
+++ src/wp-includes/post-template.php	(working copy)
@@ -382,7 +382,7 @@
 	}
 
 	if ( post_password_required( $post ) ) {
-		return __( 'There is no excerpt because this is a protected post.' );
+		return '<span class="post-password-state">' . __( 'There is no excerpt because this is a protected post.' ) . '</span>';
 	}
 
 	/**
Index: tests/phpunit/tests/post/getTheExcerpt.php
===================================================================
--- tests/phpunit/tests/post/getTheExcerpt.php	(revision 41157)
+++ tests/phpunit/tests/post/getTheExcerpt.php	(working copy)
@@ -38,10 +38,10 @@
 	 */
 	public function test_the_excerpt_password_protected_post() {
 		$post = self::factory()->post->create_and_get( array( 'post_excerpt' => 'Post excerpt', 'post_password' => '1234' ) );
-		$this->assertSame( 'There is no excerpt because this is a protected post.', get_the_excerpt( $post ) );
+		$this->assertSame( '<span class="post-password-state">There is no excerpt because this is a protected post.</span>', get_the_excerpt( $post ) );
 
 		$GLOBALS['post'] = $post;
-		$this->assertSame( "<p>There is no excerpt because this is a protected post.</p>\n", get_echo( 'the_excerpt' ) );
+		$this->assertSame( "<p><span class=\"post-password-state\">There is no excerpt because this is a protected post.</span></p>\n", get_echo( 'the_excerpt' ) );
 	}
 
 	/**
