diff --git a/core/modules/search/src/Tests/SearchCommentTest.php b/core/modules/search/src/Tests/SearchCommentTest.php
index 09ba856..7f03045 100644
--- a/core/modules/search/src/Tests/SearchCommentTest.php
+++ b/core/modules/search/src/Tests/SearchCommentTest.php
@@ -126,22 +126,14 @@ function testSearchResultsComment() {
$edit_comment['comment_body[0][format]'] = $full_html_format_id;
$this->drupalPostForm('comment/reply/node/' . $node->id() .'/comment', $edit_comment, t('Save'));
- // Post a comment with an evil script tag nearby the keyword using
- // 'FULL HTML' text format.
+ // Post a comment with an evil script using 'FULL HTML' text format.
$edit_comment2 = array();
$edit_comment2['subject[0][value]'] = "";
- $edit_comment2['comment_body[0][value]'] = "goodbye";
+ $edit_comment2['comment_body[0][value]'] = "goodbye";
+ $full_html_format_id = 'full_html';
$edit_comment2['comment_body[0][format]'] = $full_html_format_id;
$this->drupalPostForm('comment/reply/node/' . $node->id() . '/comment', $edit_comment2, t('Save'));
- // Post a comment with a keyword inside an evil script tag using
- // 'FULL HTML' text format.
- $edit_comment3 = array();
- $edit_comment3['subject[0][value]'] = "";
- $edit_comment3['comment_body[0][value]'] = "";
- $edit_comment3['comment_body[0][format]'] = $full_html_format_id;
- $this->drupalPostForm('comment/reply/node/' . $node->id() . '/comment', $edit_comment3, t('Save'));
-
// Invoke search index update.
$this->drupalLogout();
$this->cronRun();
@@ -174,28 +166,19 @@ function testSearchResultsComment() {
);
// Verify the evil comment subject is escaped in search results.
$this->drupalPostForm('search/node', $edit, t('Search'));
- $this->assertRaw('<script>alert('hello');');
- $this->assertNoRaw('