diff --git a/core/modules/comment/tests/src/Functional/CommentLinksAlterTest.php b/core/modules/comment/tests/src/Functional/CommentLinksAlterTest.php
index f8760b67dfbe2c03f935fd71a3210dbe41ac86e0..9ad663132e9a9935ddbfaaed0b531f7ec69ca2d3 100644
--- a/core/modules/comment/tests/src/Functional/CommentLinksAlterTest.php
+++ b/core/modules/comment/tests/src/Functional/CommentLinksAlterTest.php
@@ -30,7 +30,7 @@ public function testCommentLinksAlter() {
     $this->drupalLogin($this->webUser);
     $comment_text = $this->randomMachineName();
     $subject = $this->randomMachineName();
-    $comment = $this->postComment($this->node, $comment_text, $subject);
+    $this->postComment($this->node, $comment_text, $subject);
 
     $this->drupalGet('node/' . $this->node->id());