diff --git a/core/modules/comment/src/Tests/CommentInterfaceTest.php b/core/modules/comment/src/Tests/CommentInterfaceTest.php index 93b3552..8f4e2c2 100644 --- a/core/modules/comment/src/Tests/CommentInterfaceTest.php +++ b/core/modules/comment/src/Tests/CommentInterfaceTest.php @@ -75,8 +75,12 @@ function testCommentInterface() { ))); // Test changing the comment author to "Anonymous". - $comment = $this->postComment(NULL, $comment->comment_body->value, $comment->getSubject(), array('name[0][value]' => '', 'uid[0][target_id]' => ' (0)')); - $this->assertTrue($comment->getAuthorName() == t('Anonymous') && $comment->getOwnerId() == 0, 'Comment author successfully changed to anonymous.'); + $anonymous_name = t('Anonymous'); + $comment = $this->postComment(NULL, $comment->comment_body->value, $comment->getSubject(), array( + 'name[0][value]' => '', + 'uid[0][target_id]' => $anonymous_name . ' (0)', + )); + $this->assertTrue($comment->getAuthorName() == $anonymous_name && $comment->getOwnerId() == 0, 'Comment author successfully changed to anonymous.'); // Test changing the comment author to an unverified user. $random_name = $this->randomMachineName(); diff --git a/core/modules/comment/src/Tests/CommentTranslationUITest.php b/core/modules/comment/src/Tests/CommentTranslationUITest.php index 0bed6e0..7336691 100644 --- a/core/modules/comment/src/Tests/CommentTranslationUITest.php +++ b/core/modules/comment/src/Tests/CommentTranslationUITest.php @@ -150,7 +150,7 @@ protected function doTestAuthoringInfo() { 'created' => REQUEST_TIME - mt_rand(0, 1000), ); $edit = array( - 'name' => $user->getUsername(), + 'name[0][value]' => $user->getUsername(), 'date[date]' => format_date($values[$langcode]['created'], 'custom', 'Y-m-d'), 'date[time]' => format_date($values[$langcode]['created'], 'custom', 'H:i:s'), );