diff --git a/core/modules/user/src/Tests/UserUsernameTest.php b/core/modules/user/src/Tests/UserUsernameTest.php
new file mode 100644
index 0000000..2afe38a
--- /dev/null
+++ b/core/modules/user/src/Tests/UserUsernameTest.php
@@ -0,0 +1,149 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\user\Tests\UserUsernameTest.
+ */
+
+namespace Drupal\user\Tests;
+
+use Drupal\Component\Utility\SafeMarkup;
+use Drupal\Component\Utility\Unicode;
+use Drupal\comment\Tests\CommentTestTrait;
+use Drupal\simpletest\WebTestBase;
+
+/**
+ * Tests username functionality.
+ *
+ * @group user
+ */
+class UserUsernameTest extends WebTestBase {
+
+  use CommentTestTrait;
+
+  /**
+   * Modules to enable.
+   *
+   * @var array
+   */
+  public static $modules = array(
+    'node',
+    'block',
+    'comment',
+    'user_test_views',
+  );
+
+  /**
+   * The user with the shorter username.
+   *
+   * @var \Drupal\user\Entity\User
+   */
+  protected $userShortName;
+
+  /**
+   * The user with the longer username.
+   *
+   * @var \Drupal\user\Entity\User
+   */
+  protected $userLongName;
+
+  /**
+   * {@inheritdoc}
+   */
+  public function setUp() {
+    parent::setUp();
+
+    $this->drupalCreateContentType(array('type' => 'article', 'name' => 'Article'));
+    $this->addDefaultCommentField('node', 'article');
+
+    // Create user with short username.
+    $this->userShortName = $this->drupalCreateUser(
+      array(
+        'access content',
+        'access comments',
+        'post comments',
+        'skip comment approval',
+        'create article content',
+      ),
+      $this->randomString(30)
+    );
+
+    // Create user with long username.
+    $this->userLongName = $this->drupalCreateUser(
+      array(
+        'access content',
+        'access comments',
+        'post comments',
+        'skip comment approval',
+        'create article content',
+      ),
+      $this->randomString(31)
+    );
+  }
+
+  /**
+   * Tests author name display on nodes.
+   */
+  public function testTruncatedNodeAuthorName() {
+    // Test untruncated username.
+    $this->drupalLogin($this->userShortName);
+
+    $node = $this->drupalCreateNode(array('type' => 'article'));
+    $this->drupalGet('node/' . $node->id());
+    $this->assertText(SafeMarkup::checkPlain($this->userShortName->getUsername()), 'Untruncated username found.');
+
+    // Test truncated username.
+    $this->drupalLogin($this->userLongName);
+
+    $node = $this->drupalCreateNode(array('type' => 'article'));
+    $this->drupalGet('node/' . $node->id());
+    $this->assertNoText(SafeMarkup::checkPlain($this->userLongName->getUsername()), 'Untruncated username not found.');
+    $this->assertText(SafeMarkup::checkPlain(Unicode::truncate($this->userLongName->getUsername(), 29, FALSE, TRUE)), 'Truncated username found.');
+  }
+
+  /**
+   * Tests author name display on comments.
+   */
+  public function testTruncatedCommentAuthorName() {
+    $node = $this->drupalCreateNode(array('type' => 'article'));
+
+    $this->drupalLogin($this->userShortName);
+    $comment = array(
+      'subject[0][value]' => $this->randomMachineName(),
+      'comment_body[0][value]' => $this->randomMachineName(20),
+    );
+    $this->drupalPostForm('comment/reply/node/' . $node->id() . '/comment', $comment, t('Save'));
+    $this->assertText(SafeMarkup::checkPlain($this->userShortName->getUsername()), 'Untruncated username found.');
+    $this->drupalLogin($this->userLongName);
+    $comment = array(
+      'subject[0][value]' => $this->randomMachineName(),
+      'comment_body[0][value]' => $this->randomMachineName(20),
+    );
+    $this->drupalPostForm('comment/reply/node/' . $node->id() . '/comment', $comment, t('Save'));
+    $this->assertNoText(SafeMarkup::checkPlain($this->userLongName->getUsername()), 'Untruncated username not found.');
+    $this->assertText(SafeMarkup::checkPlain(Unicode::truncate($this->userLongName->getUsername(), 29, FALSE, TRUE)), 'Truncated username found.');
+  }
+
+
+  /**
+   * Tests username display in Who's New block.
+   */
+  public function testTruncatedWhosNewName() {
+    // Enable Who's New block.
+    $this->drupalPlaceBlock('views_block:who_s_new-block_1');
+
+    $this->drupalGet('<front>');
+
+    // The Who's new block requires a last access to be set.
+    // Log the users in for them to show up.
+    $this->drupalLogin($this->userShortName);
+    $this->drupalLogin($this->userLongName);
+    // Log user out to prevent a false negative
+    $this->drupalLogout();
+
+    $this->assertText(SafeMarkup::checkPlain($this->userShortName->getUsername()), 'Untruncated username found.');
+    $this->assertNoText(SafeMarkup::checkPlain($this->userLongName->getUsername()), 'Untruncated username not found.');
+    $this->assertText(SafeMarkup::checkPlain(Unicode::truncate($this->userLongName->getUsername(), 29, FALSE, TRUE)), 'Truncated username found.');
+  }
+
+}
