diff --git a/core/modules/user/src/Tests/UserUsernameTest.php b/core/modules/user/src/Tests/UserUsernameTest.php index ae95336..b6ee9b2 100644 --- a/core/modules/user/src/Tests/UserUsernameTest.php +++ b/core/modules/user/src/Tests/UserUsernameTest.php @@ -99,8 +99,8 @@ public function testTruncatedNodeAuthorName() { $this->drupalGet('node/' . $node->id()); // Tests if the username is trimmed to USERNAME_TRIM_LENGTH value. - // @see template_preprocess_username(). - $this->assertTrue(Html::escape($this->userLongName->getUsername())); + // @see template_preprocess_username() + $this->assertText(Html::escape($this->userLongName->getUsername())); $this->assertText(Html::escape(Unicode::truncate($this->userLongName->getUsername(), USERNAME_TRIM_LENGTH - 1, FALSE, TRUE))); } @@ -111,12 +111,12 @@ public function testTruncatedCommentAuthorName() { $node = $this->drupalCreateNode(['type' => 'article']); $this->drupalLogin($this->userShortName); - $comment =[ + $comment = [ 'subject[0][value]' => $this->randomMachineName(), 'comment_body[0][value]' => $this->randomMachineName(20), ]; $this->drupalPostForm('comment/reply/node/' . $node->id() . '/comment', $comment, t('Save')); - $this->assertTrue(Html::escape($this->userLongName->getUsername())); + $this->assertText(Html::escape($this->userLongName->getUsername())); $this->drupalLogin($this->userLongName); $comment = [ 'subject[0][value]' => $this->randomMachineName(), @@ -124,7 +124,7 @@ public function testTruncatedCommentAuthorName() { ]; // Tests if the username is trimmed to USERNAME_TRIM_LENGTH value. - // @see template_preprocess_username(). + // @see template_preprocess_username() $this->drupalPostForm('comment/reply/node/' . $node->id() . '/comment', $comment, t('Save')); $this->assertNoText(Html::escape($this->userLongName->getUsername())); $this->assertText(Html::escape(Unicode::truncate($this->userLongName->getUsername(), USERNAME_TRIM_LENGTH - 1, FALSE, TRUE))); @@ -149,7 +149,7 @@ public function testTruncatedWhosNewName() { $this->drupalGet(''); // Tests if the username is trimmed to USERNAME_TRIM_LENGTH value. - // @see template_preprocess_username(). + // @see template_preprocess_username() $this->assertText(Html::escape($this->userShortName->getUsername())); $this->assertNoText(Html::escape($this->userLongName->getUsername())); $this->assertText(Html::escape(Unicode::truncate($this->userLongName->getUsername(), USERNAME_TRIM_LENGTH - 1, FALSE, TRUE)));