diff --git a/core/modules/user/src/AccountForm.php b/core/modules/user/src/AccountForm.php
index dbdb08b..ea39cf6 100644
--- a/core/modules/user/src/AccountForm.php
+++ b/core/modules/user/src/AccountForm.php
@@ -106,7 +106,7 @@ public function form(array $form, FormStateInterface $form_state) {
         'autocapitalize' => 'off',
         'spellcheck' => 'false',
       ),
-      '#default_value' => (!$register ? $account->getUsername() : ''),
+      '#default_value' => (!$register ? $account->getDisplayName() : ''),
       '#access' => ($register || ($user->id() == $account->id() && $user->hasPermission('change own username')) || $admin),
     );
 
diff --git a/core/modules/user/src/Controller/UserController.php b/core/modules/user/src/Controller/UserController.php
index 779cf90..f48266a 100644
--- a/core/modules/user/src/Controller/UserController.php
+++ b/core/modules/user/src/Controller/UserController.php
@@ -121,7 +121,7 @@ public function resetPass(Request $request, $uid, $timestamp, $hash) {
         /** @var \Drupal\user\UserInterface $reset_link_user */
         if ($reset_link_user = $this->userStorage->load($uid)) {
           drupal_set_message($this->t('Another user (%other_user) is already logged into the site on this computer, but you tried to use a one-time link for user %resetting_user. Please <a href=":logout">log out</a> and try using the link again.',
-            array('%other_user' => $account->getUsername(), '%resetting_user' => $reset_link_user->getUsername(), ':logout' => $this->url('user.logout'))), 'warning');
+            array('%other_user' => $account->getDisplayName(), '%resetting_user' => $reset_link_user->getDisplayName(), ':logout' => $this->url('user.logout'))), 'warning');
         }
         else {
           // Invalid one-time link specifies an unknown user.
@@ -268,7 +268,7 @@ public function userPage() {
    *   NULL.
    */
   public function userTitle(UserInterface $user = NULL) {
-    return $user ? ['#markup' => $user->getUsername(), '#allowed_tags' => Xss::getHtmlTagList()] : '';
+    return $user ? ['#markup' => $user->getDisplayName(), '#allowed_tags' => Xss::getHtmlTagList()] : '';
   }
 
   /**
diff --git a/core/modules/user/src/Form/UserPasswordForm.php b/core/modules/user/src/Form/UserPasswordForm.php
index 83d8e0a..eac066c 100644
--- a/core/modules/user/src/Form/UserPasswordForm.php
+++ b/core/modules/user/src/Form/UserPasswordForm.php
@@ -139,7 +139,7 @@ public function submitForm(array &$form, FormStateInterface $form_state) {
     // Mail one time login URL and instructions using current language.
     $mail = _user_mail_notify('password_reset', $account, $langcode);
     if (!empty($mail)) {
-      $this->logger('user')->notice('Password reset instructions mailed to %name at %email.', array('%name' => $account->getUsername(), '%email' => $account->getEmail()));
+      $this->logger('user')->notice('Password reset instructions mailed to %name at %email.', array('%name' => $account->getDisplayName(), '%email' => $account->getEmail()));
       drupal_set_message($this->t('Further instructions have been sent to your email address.'));
     }
 
diff --git a/core/modules/user/src/Form/UserPasswordResetForm.php b/core/modules/user/src/Form/UserPasswordResetForm.php
index 1372415..a85ed2c 100644
--- a/core/modules/user/src/Form/UserPasswordResetForm.php
+++ b/core/modules/user/src/Form/UserPasswordResetForm.php
@@ -38,12 +38,12 @@ public function getFormId() {
    */
   public function buildForm(array $form, FormStateInterface $form_state, AccountInterface $user = NULL, $expiration_date = NULL, $timestamp = NULL, $hash = NULL) {
     if ($expiration_date) {
-      $form['message'] = array('#markup' => $this->t('<p>This is a one-time login for %user_name and will expire on %expiration_date.</p><p>Click on this button to log in to the site and change your password.</p>', array('%user_name' => $user->getUsername(), '%expiration_date' => $expiration_date)));
+      $form['message'] = array('#markup' => $this->t('<p>This is a one-time login for %user_name and will expire on %expiration_date.</p><p>Click on this button to log in to the site and change your password.</p>', array('%user_name' => $user->getDisplayName(), '%expiration_date' => $expiration_date)));
       $form['#title'] = $this->t('Reset password');
     }
     else {
       // No expiration for first time login.
-      $form['message'] = array('#markup' => $this->t('<p>This is a one-time login for %user_name.</p><p>Click on this button to log in to the site and change your password.</p>', array('%user_name' => $user->getUsername())));
+      $form['message'] = array('#markup' => $this->t('<p>This is a one-time login for %user_name.</p><p>Click on this button to log in to the site and change your password.</p>', array('%user_name' => $user->getDisplayName())));
       $form['#title'] = $this->t('Set password');
     }
 
diff --git a/core/modules/user/src/Plugin/views/argument_validator/UserName.php b/core/modules/user/src/Plugin/views/argument_validator/UserName.php
index 88ffd64..6d3755c 100644
--- a/core/modules/user/src/Plugin/views/argument_validator/UserName.php
+++ b/core/modules/user/src/Plugin/views/argument_validator/UserName.php
@@ -56,7 +56,7 @@ public function validateArgument($argument) {
 
     // Validate each account. If any fails break out and return false.
     foreach ($accounts as $account) {
-      if (!in_array($account->getUserName(), $names) || !$this->validateEntity($account)) {
+      if (!in_array($account->getDisplayName(), $names) || !$this->validateEntity($account)) {
         return FALSE;
       }
     }
diff --git a/core/modules/user/src/RegisterForm.php b/core/modules/user/src/RegisterForm.php
index 9bc047b..f43b785 100644
--- a/core/modules/user/src/RegisterForm.php
+++ b/core/modules/user/src/RegisterForm.php
@@ -101,7 +101,7 @@ public function save(array $form, FormStateInterface $form_state) {
 
     // New administrative account without notification.
     if ($admin && !$notify) {
-      drupal_set_message($this->t('Created a new user account for <a href=":url">%name</a>. No email has been sent.', array(':url' => $account->url(), '%name' => $account->getUsername())));
+      drupal_set_message($this->t('Created a new user account for <a href=":url">%name</a>. No email has been sent.', array(':url' => $account->url(), '%name' => $account->getDisplayName())));
     }
     // No email verification required; log in user immediately.
     elseif (!$admin && !\Drupal::config('user.settings')->get('verify_mail') && $account->isActive()) {
@@ -113,13 +113,13 @@ public function save(array $form, FormStateInterface $form_state) {
     // No administrator approval required.
     elseif ($account->isActive() || $notify) {
       if (!$account->getEmail() && $notify) {
-        drupal_set_message($this->t('The new user <a href=":url">%name</a> was created without an email address, so no welcome message was sent.', array(':url' => $account->url(), '%name' => $account->getUsername())));
+        drupal_set_message($this->t('The new user <a href=":url">%name</a> was created without an email address, so no welcome message was sent.', array(':url' => $account->url(), '%name' => $account->getDisplayName())));
       }
       else {
         $op = $notify ? 'register_admin_created' : 'register_no_approval_required';
         if (_user_mail_notify($op, $account)) {
           if ($notify) {
-            drupal_set_message($this->t('A welcome message with further instructions has been emailed to the new user <a href=":url">%name</a>.', array(':url' => $account->url(), '%name' => $account->getUsername())));
+            drupal_set_message($this->t('A welcome message with further instructions has been emailed to the new user <a href=":url">%name</a>.', array(':url' => $account->url(), '%name' => $account->getDisplayName())));
           }
           else {
             drupal_set_message($this->t('A welcome message with further instructions has been sent to your email address.'));
diff --git a/core/modules/user/src/Tests/UserAdminTest.php b/core/modules/user/src/Tests/UserAdminTest.php
index 8d4a22b..b4ec935 100644
--- a/core/modules/user/src/Tests/UserAdminTest.php
+++ b/core/modules/user/src/Tests/UserAdminTest.php
@@ -45,10 +45,10 @@ function testUserAdmin() {
     $admin_user->save();
     $this->drupalLogin($admin_user);
     $this->drupalGet('admin/people');
-    $this->assertText($user_a->getUsername(), 'Found user A on admin users page');
-    $this->assertText($user_b->getUsername(), 'Found user B on admin users page');
-    $this->assertText($user_c->getUsername(), 'Found user C on admin users page');
-    $this->assertText($admin_user->getUsername(), 'Found Admin user on admin users page');
+    $this->assertText($user_a->getDisplayName(), 'Found user A on admin users page');
+    $this->assertText($user_b->getDisplayName(), 'Found user B on admin users page');
+    $this->assertText($user_c->getDisplayName(), 'Found user C on admin users page');
+    $this->assertText($admin_user->getDisplayName(), 'Found Admin user on admin users page');
 
     // Test for existence of edit link in table.
     $link = $user_a->link(t('Edit'), 'edit-form', array('query' => array('destination' => $user_a->url('collection'))));
@@ -63,23 +63,23 @@ function testUserAdmin() {
     $this->assertNoField('edit-reduce-duplicates', 'Reduce duplicates form element not found in exposed filters.');
 
     // Filter the users by name/email.
-    $this->drupalGet('admin/people', array('query' => array('user' => $user_a->getUsername())));
+    $this->drupalGet('admin/people', array('query' => array('user' => $user_a->getDisplayName())));
     $result = $this->xpath('//table/tbody/tr');
     $this->assertEqual(1, count($result), 'Filter by username returned the right amount.');
-    $this->assertEqual($user_a->getUsername(), (string) $result[0]->td[1]->span, 'Filter by username returned the right user.');
+    $this->assertEqual($user_a->getDisplayName(), (string) $result[0]->td[1]->span, 'Filter by username returned the right user.');
 
     $this->drupalGet('admin/people', array('query' => array('user' => $user_a->getEmail())));
     $result = $this->xpath('//table/tbody/tr');
     $this->assertEqual(1, count($result), 'Filter by username returned the right amount.');
-    $this->assertEqual($user_a->getUsername(), (string) $result[0]->td[1]->span, 'Filter by username returned the right user.');
+    $this->assertEqual($user_a->getDisplayName(), (string) $result[0]->td[1]->span, 'Filter by username returned the right user.');
 
     // Filter the users by permission 'administer taxonomy'.
     $this->drupalGet('admin/people', array('query' => array('permission' => 'administer taxonomy')));
 
     // Check if the correct users show up.
-    $this->assertNoText($user_a->getUsername(), 'User A not on filtered by perm admin users page');
-    $this->assertText($user_b->getUsername(), 'Found user B on filtered by perm admin users page');
-    $this->assertText($user_c->getUsername(), 'Found user C on filtered by perm admin users page');
+    $this->assertNoText($user_a->getDisplayName(), 'User A not on filtered by perm admin users page');
+    $this->assertText($user_b->getDisplayName(), 'Found user B on filtered by perm admin users page');
+    $this->assertText($user_c->getDisplayName(), 'Found user C on filtered by perm admin users page');
 
     // Filter the users by role. Grab the system-generated role name for User C.
     $roles = $user_c->getRoles();
@@ -87,9 +87,9 @@ function testUserAdmin() {
     $this->drupalGet('admin/people', array('query' => array('role' => reset($roles))));
 
     // Check if the correct users show up when filtered by role.
-    $this->assertNoText($user_a->getUsername(), 'User A not on filtered by role on admin users page');
-    $this->assertNoText($user_b->getUsername(), 'User B not on filtered by role on admin users page');
-    $this->assertText($user_c->getUsername(), 'User C on filtered by role on admin users page');
+    $this->assertNoText($user_a->getDisplayName(), 'User A not on filtered by role on admin users page');
+    $this->assertNoText($user_b->getDisplayName(), 'User B not on filtered by role on admin users page');
+    $this->assertText($user_c->getDisplayName(), 'User C on filtered by role on admin users page');
 
     // Test blocking of a user.
     $account = $user_storage->load($user_c->id());
@@ -113,9 +113,9 @@ function testUserAdmin() {
 
     // Test filtering on admin page for blocked users
     $this->drupalGet('admin/people', array('query' => array('status' => 2)));
-    $this->assertNoText($user_a->getUsername(), 'User A not on filtered by status on admin users page');
-    $this->assertNoText($user_b->getUsername(), 'User B not on filtered by status on admin users page');
-    $this->assertText($user_c->getUsername(), 'User C on filtered by status on admin users page');
+    $this->assertNoText($user_a->getDisplayName(), 'User A not on filtered by status on admin users page');
+    $this->assertNoText($user_b->getDisplayName(), 'User B not on filtered by status on admin users page');
+    $this->assertText($user_c->getDisplayName(), 'User C on filtered by status on admin users page');
 
     // Test unblocking of a user from /admin/people page and sending of activation mail
     $editunblock = array();
diff --git a/core/modules/user/src/Tests/UserBlocksTest.php b/core/modules/user/src/Tests/UserBlocksTest.php
index 9216a27..cec0d0e 100644
--- a/core/modules/user/src/Tests/UserBlocksTest.php
+++ b/core/modules/user/src/Tests/UserBlocksTest.php
@@ -67,7 +67,7 @@ function testUserLoginBlock() {
 
     // Log in using the block.
     $edit = array();
-    $edit['name'] = $user->getUsername();
+    $edit['name'] = $user->getDisplayName();
     $edit['pass'] = $user->pass_raw;
     $this->drupalPostForm('admin/people/permissions', $edit, t('Log in'));
     $this->assertNoText(t('User login'), 'Logged in.');
@@ -126,10 +126,10 @@ function testWhosOnlineBlock() {
     $content = entity_view($block, 'block');
     $this->setRawContent(\Drupal::service('renderer')->renderRoot($content));
     $this->assertRaw(t('2 users'), 'Correct number of online users (2 users).');
-    $this->assertText($user1->getUsername(), 'Active user 1 found in online list.');
-    $this->assertText($user2->getUsername(), 'Active user 2 found in online list.');
-    $this->assertNoText($user3->getUsername(), 'Inactive user not found in online list.');
-    $this->assertTrue(strpos($this->getRawContent(), $user1->getUsername()) > strpos($this->getRawContent(), $user2->getUsername()), 'Online users are ordered correctly.');
+    $this->assertText($user1->getDisplayName(), 'Active user 1 found in online list.');
+    $this->assertText($user2->getDisplayName(), 'Active user 2 found in online list.');
+    $this->assertNoText($user3->getDisplayName(), 'Inactive user not found in online list.');
+    $this->assertTrue(strpos($this->getRawContent(), $user1->getDisplayName()) > strpos($this->getRawContent(), $user2->getDisplayName()), 'Online users are ordered correctly.');
   }
 
   /**
diff --git a/core/modules/user/src/Tests/UserCancelTest.php b/core/modules/user/src/Tests/UserCancelTest.php
index 4ce4d91..b66f70e 100644
--- a/core/modules/user/src/Tests/UserCancelTest.php
+++ b/core/modules/user/src/Tests/UserCancelTest.php
@@ -84,7 +84,7 @@ public function testUserCancelChangePermission() {
     $this->drupalPostForm('user_form_test_cancel/' . $account->id(), array(), t('Cancel account'));
 
     // Confirm deletion.
-    $this->assertRaw(t('%name has been deleted.', array('%name' => $account->getUsername())), 'User deleted.');
+    $this->assertRaw(t('%name has been deleted.', array('%name' => $account->getDisplayName())), 'User deleted.');
     $this->assertFalse(User::load($account->id()), 'User is not found in the database.');
   }
 
@@ -215,7 +215,7 @@ function testUserBlock() {
     $this->assertTrue($account->isBlocked(), 'User has been blocked.');
 
     // Confirm that the confirmation message made it through to the end user.
-    $this->assertRaw(t('%name has been disabled.', array('%name' => $account->getUsername())), "Confirmation message displayed to user.");
+    $this->assertRaw(t('%name has been disabled.', array('%name' => $account->getDisplayName())), "Confirmation message displayed to user.");
   }
 
   /**
@@ -285,7 +285,7 @@ function testUserBlockUnpublish() {
     $this->assertFalse($comment->isPublished(), 'Comment of the user has been unpublished.');
 
     // Confirm that the confirmation message made it through to the end user.
-    $this->assertRaw(t('%name has been disabled.', array('%name' => $account->getUsername())), "Confirmation message displayed to user.");
+    $this->assertRaw(t('%name has been disabled.', array('%name' => $account->getDisplayName())), "Confirmation message displayed to user.");
   }
 
   /**
@@ -365,7 +365,7 @@ function testUserAnonymize() {
     $this->assertEqual($test_comment->getAuthorName(), $anonymous_user->getDisplayName(), 'Comment of the user has been attributed to anonymous user name.');
 
     // Confirm that the confirmation message made it through to the end user.
-    $this->assertRaw(t('%name has been deleted.', array('%name' => $account->getUsername())), "Confirmation message displayed to user.");
+    $this->assertRaw(t('%name has been deleted.', array('%name' => $account->getDisplayName())), "Confirmation message displayed to user.");
   }
 
   /**
@@ -483,7 +483,7 @@ function testUserDelete() {
     $this->assertFalse(Comment::load($comment->id()), 'Comment of the user has been deleted.');
 
     // Confirm that the confirmation message made it through to the end user.
-    $this->assertRaw(t('%name has been deleted.', array('%name' => $account->getUsername())), "Confirmation message displayed to user.");
+    $this->assertRaw(t('%name has been deleted.', array('%name' => $account->getDisplayName())), "Confirmation message displayed to user.");
   }
 
   /**
@@ -502,12 +502,12 @@ function testUserCancelByAdmin() {
     // Delete regular user.
     $this->drupalGet('user/' . $account->id() . '/edit');
     $this->drupalPostForm(NULL, NULL, t('Cancel account'));
-    $this->assertRaw(t('Are you sure you want to cancel the account %name?', array('%name' => $account->getUsername())), 'Confirmation form to cancel account displayed.');
+    $this->assertRaw(t('Are you sure you want to cancel the account %name?', array('%name' => $account->getDisplayName())), 'Confirmation form to cancel account displayed.');
     $this->assertText(t('Select the method to cancel the account above.'), 'Allows to select account cancellation method.');
 
     // Confirm deletion.
     $this->drupalPostForm(NULL, NULL, t('Cancel account'));
-    $this->assertRaw(t('%name has been deleted.', array('%name' => $account->getUsername())), 'User deleted.');
+    $this->assertRaw(t('%name has been deleted.', array('%name' => $account->getDisplayName())), 'User deleted.');
     $this->assertFalse(User::load($account->id()), 'User is not found in the database.');
   }
 
@@ -530,12 +530,12 @@ function testUserWithoutEmailCancelByAdmin() {
     // Delete regular user without email address.
     $this->drupalGet('user/' . $account->id() . '/edit');
     $this->drupalPostForm(NULL, NULL, t('Cancel account'));
-    $this->assertRaw(t('Are you sure you want to cancel the account %name?', array('%name' => $account->getUsername())), 'Confirmation form to cancel account displayed.');
+    $this->assertRaw(t('Are you sure you want to cancel the account %name?', array('%name' => $account->getDisplayName())), 'Confirmation form to cancel account displayed.');
     $this->assertText(t('Select the method to cancel the account above.'), 'Allows to select account cancellation method.');
 
     // Confirm deletion.
     $this->drupalPostForm(NULL, NULL, t('Cancel account'));
-    $this->assertRaw(t('%name has been deleted.', array('%name' => $account->getUsername())), 'User deleted.');
+    $this->assertRaw(t('%name has been deleted.', array('%name' => $account->getDisplayName())), 'User deleted.');
     $this->assertFalse(User::load($account->id()), 'User is not found in the database.');
   }
 
@@ -577,7 +577,7 @@ function testMassUserCancelByAdmin() {
     $this->drupalPostForm(NULL, NULL, t('Cancel accounts'));
     $status = TRUE;
     foreach ($users as $account) {
-      $status = $status && (strpos($this->content, $account->getUsername() . '</em> has been deleted.') !== FALSE);
+      $status = $status && (strpos($this->content, $account->getDisplayName() . '</em> has been deleted.') !== FALSE);
       $user_storage->resetCache(array($account->id()));
       $status = $status && !$user_storage->load($account->id());
     }
diff --git a/core/modules/user/src/Tests/UserEditTest.php b/core/modules/user/src/Tests/UserEditTest.php
index 225b194..329891f 100644
--- a/core/modules/user/src/Tests/UserEditTest.php
+++ b/core/modules/user/src/Tests/UserEditTest.php
@@ -21,7 +21,7 @@ function testUserEdit() {
     $this->drupalLogin($user1);
 
     // Test that error message appears when attempting to use a non-unique user name.
-    $edit['name'] = $user2->getUsername();
+    $edit['name'] = $user2->getDisplayName();
     $this->drupalPostForm("user/" . $user1->id() . "/edit", $edit, t('Save'));
     $this->assertRaw(t('The username %name is already taken.', array('%name' => $edit['name'])));
 
diff --git a/core/modules/user/src/Tests/UserEntityCallbacksTest.php b/core/modules/user/src/Tests/UserEntityCallbacksTest.php
index 944b352..38d9a89 100644
--- a/core/modules/user/src/Tests/UserEntityCallbacksTest.php
+++ b/core/modules/user/src/Tests/UserEntityCallbacksTest.php
@@ -45,20 +45,20 @@ protected function setUp() {
    * Test label callback.
    */
   function testLabelCallback() {
-    $this->assertEqual($this->account->label(), $this->account->getUsername(), 'The username should be used as label');
+    $this->assertEqual($this->account->label(), $this->account->getDisplayName(), 'The username should be used as label');
 
     // Setup a random anonymous name to be sure the name is used.
     $name = $this->randomMachineName();
     $this->config('user.settings')->set('anonymous', $name)->save();
     $this->assertEqual($this->anonymous->label(), $name, 'The variable anonymous should be used for name of uid 0');
     $this->assertEqual($this->anonymous->getDisplayName(), $name, 'The variable anonymous should be used for display name of uid 0');
-    $this->assertEqual($this->anonymous->getUserName(), '', 'The raw anonymous user name should be empty string');
+    $this->assertEqual($this->anonymous->getDisplayName(), '', 'The raw anonymous user name should be empty string');
 
     // Set to test the altered username.
     \Drupal::state()->set('user_hooks_test_user_format_name_alter', TRUE);
 
     $this->assertEqual($this->account->getDisplayName(), '<em>' . $this->account->id() . '</em>', 'The user display name should be altered.');
-    $this->assertEqual($this->account->getUsername(), $this->account->name->value, 'The user name should not be altered.');
+    $this->assertEqual($this->account->getDisplayName(), $this->account->name->value, 'The user name should not be altered.');
   }
 
 }
diff --git a/core/modules/user/src/Tests/UserLoginTest.php b/core/modules/user/src/Tests/UserLoginTest.php
index af00c74..584d23e 100644
--- a/core/modules/user/src/Tests/UserLoginTest.php
+++ b/core/modules/user/src/Tests/UserLoginTest.php
@@ -23,7 +23,7 @@ function testLoginCacheTagsAndDestination() {
 
     $user = $this->drupalCreateUser(array());
     $this->drupalGet('user/login', array('query' => array('destination' => 'foo')));
-    $edit = array('name' => $user->getUserName(), 'pass' => $user->pass_raw);
+    $edit = array('name' => $user->getDisplayName(), 'pass' => $user->pass_raw);
     $this->drupalPostForm(NULL, $edit, t('Log in'));
     $this->assertUrl('foo', [], 'Redirected to the correct URL');
   }
@@ -156,7 +156,7 @@ function testPasswordRehashOnLogin() {
    */
   function assertFailedLogin($account, $flood_trigger = NULL) {
     $edit = array(
-      'name' => $account->getUsername(),
+      'name' => $account->getDisplayName(),
       'pass' => $account->pass_raw,
     );
     $this->drupalPostForm('user/login', $edit, t('Log in'));
diff --git a/core/modules/user/src/Tests/UserPasswordResetTest.php b/core/modules/user/src/Tests/UserPasswordResetTest.php
index c012e9f..039e1c9 100644
--- a/core/modules/user/src/Tests/UserPasswordResetTest.php
+++ b/core/modules/user/src/Tests/UserPasswordResetTest.php
@@ -85,12 +85,12 @@ function testUserPasswordReset() {
     $this->assertEqual(count($this->drupalGetMails(array('id' => 'user_password_reset'))), 0, 'No email was sent when requesting a password for an invalid account.');
 
     // Reset the password by username via the password reset page.
-    $edit['name'] = $this->account->getUsername();
+    $edit['name'] = $this->account->getDisplayName();
     $this->drupalPostForm(NULL, $edit, t('Submit'));
 
     // Verify that the user was sent an email.
     $this->assertMail('to', $this->account->getEmail(), 'Password email sent to user.');
-    $subject = t('Replacement login information for @username at @site', array('@username' => $this->account->getUsername(), '@site' => $this->config('system.site')->get('name')));
+    $subject = t('Replacement login information for @username at @site', array('@username' => $this->account->getDisplayName(), '@site' => $this->config('system.site')->get('name')));
     $this->assertMail('subject', $subject, 'Password reset email subject is correct.');
 
     $resetURL = $this->getResetURL();
@@ -105,14 +105,14 @@ function testUserPasswordReset() {
     $this->assertFalse($this->drupalGetHeader('X-Drupal-Cache'));
 
     // Check the one-time login page.
-    $this->assertText($this->account->getUsername(), 'One-time login page contains the correct username.');
+    $this->assertText($this->account->getDisplayName(), 'One-time login page contains the correct username.');
     $this->assertText(t('This login can be used only once.'), 'Found warning about one-time login.');
     $this->assertTitle(t('Reset password | Drupal'), 'Page title is "Reset password".');
 
     // Check successful login.
     $this->drupalPostForm(NULL, NULL, t('Log in'));
     $this->assertLink(t('Log out'));
-    $this->assertTitle(t('@name | @site', array('@name' => $this->account->getUsername(), '@site' => $this->config('system.site')->get('name'))), 'Logged in using password reset link.');
+    $this->assertTitle(t('@name | @site', array('@name' => $this->account->getDisplayName(), '@site' => $this->config('system.site')->get('name'))), 'Logged in using password reset link.');
 
     // Make sure the ajax request from uploading a user picture does not
     // invalidate the reset token.
@@ -174,14 +174,14 @@ function testUserPasswordReset() {
     $this->drupalGet('user/password');
     // Count email messages before to compare with after.
     $before = count($this->drupalGetMails(array('id' => 'user_password_reset')));
-    $edit = array('name' => $blocked_account->getUsername());
+    $edit = array('name' => $blocked_account->getDisplayName());
     $this->drupalPostForm(NULL, $edit, t('Submit'));
-    $this->assertRaw(t('%name is blocked or has not been activated yet.', array('%name' => $blocked_account->getUsername())), 'Notified user blocked accounts can not request a new password');
+    $this->assertRaw(t('%name is blocked or has not been activated yet.', array('%name' => $blocked_account->getDisplayName())), 'Notified user blocked accounts can not request a new password');
     $this->assertTrue(count($this->drupalGetMails(array('id' => 'user_password_reset'))) === $before, 'No email was sent when requesting password reset for a blocked account');
 
     // Verify a password reset link is invalidated when the user's email address changes.
     $this->drupalGet('user/password');
-    $edit = array('name' => $this->account->getUsername());
+    $edit = array('name' => $this->account->getDisplayName());
     $this->drupalPostForm(NULL, $edit, t('Submit'));
     $old_email_reset_link = $this->getResetURL();
     $this->account->setEmail("1" . $this->account->getEmail());
@@ -193,12 +193,12 @@ function testUserPasswordReset() {
     // Verify a password reset link will automatically log a user when /login is
     // appended.
     $this->drupalGet('user/password');
-    $edit = array('name' => $this->account->getUsername());
+    $edit = array('name' => $this->account->getDisplayName());
     $this->drupalPostForm(NULL, $edit, t('Submit'));
     $reset_url = $this->getResetURL();
     $this->drupalGet($reset_url . '/login');
     $this->assertLink(t('Log out'));
-    $this->assertTitle(t('@name | @site', array('@name' => $this->account->getUsername(), '@site' => $this->config('system.site')->get('name'))), 'Logged in using password reset link.');
+    $this->assertTitle(t('@name | @site', array('@name' => $this->account->getDisplayName(), '@site' => $this->config('system.site')->get('name'))), 'Logged in using password reset link.');
 
     // Ensure blocked and deleted accounts can't access the user.reset.login
     // route.
@@ -243,7 +243,7 @@ public function testUserPasswordResetLoggedIn() {
     $this->drupalGet($resetURL);
     $this->assertRaw(new FormattableMarkup(
       'Another user (%other_user) is already logged into the site on this computer, but you tried to use a one-time link for user %resetting_user. Please <a href=":logout">log out</a> and try using the link again.',
-      ['%other_user' => $this->account->getUsername(), '%resetting_user' => $another_account->getUsername(), ':logout' => Url::fromRoute('user.logout')->toString()]
+      ['%other_user' => $this->account->getDisplayName(), '%resetting_user' => $another_account->getDisplayName(), ':logout' => Url::fromRoute('user.logout')->toString()]
     ));
 
     $another_account->delete();
@@ -329,7 +329,7 @@ function testResetImpersonation() {
     $attack_reset_url = str_replace("user/reset/{$user1->id()}", "user/reset/{$user2->id()}", $reset_url);
     $this->drupalGet($attack_reset_url);
     $this->drupalPostForm(NULL, NULL, t('Log in'));
-    $this->assertNoText($user2->getUsername(), 'The invalid password reset page does not show the user name.');
+    $this->assertNoText($user2->getDisplayName(), 'The invalid password reset page does not show the user name.');
     $this->assertUrl('user/password', array(), 'The user is redirected to the password reset request page.');
     $this->assertText('You have tried to use a one-time login link that has either been used or is no longer valid. Please request a new one using the form below.');
   }
diff --git a/core/modules/user/src/Tests/UserPictureTest.php b/core/modules/user/src/Tests/UserPictureTest.php
index 3f8db42..3888f23 100644
--- a/core/modules/user/src/Tests/UserPictureTest.php
+++ b/core/modules/user/src/Tests/UserPictureTest.php
@@ -96,7 +96,7 @@ function testPictureOnNodeComment() {
     $image_style_id = $this->config('core.entity_view_display.user.user.compact')->get('content.user_picture.settings.image_style');
     $style = ImageStyle::load($image_style_id);
     $image_url = file_url_transform_relative($style->buildUrl($file->getfileUri()));
-    $alt_text = 'Profile picture for user ' . $this->webUser->getUsername();
+    $alt_text = 'Profile picture for user ' . $this->webUser->getDisplayName();
 
     // Verify that the image is displayed on the node page.
     $this->drupalGet('node/' . $node->id());
diff --git a/core/modules/user/src/Tests/UserRegistrationTest.php b/core/modules/user/src/Tests/UserRegistrationTest.php
index 0831362..435a17e 100644
--- a/core/modules/user/src/Tests/UserRegistrationTest.php
+++ b/core/modules/user/src/Tests/UserRegistrationTest.php
@@ -256,7 +256,7 @@ function testRegistrationDefaultValues() {
     $accounts = $this->container->get('entity_type.manager')->getStorage('user')
       ->loadByProperties(['name' => $name, 'mail' => $mail]);
     $new_user = reset($accounts);
-    $this->assertEqual($new_user->getUsername(), $name, 'Username matches.');
+    $this->assertEqual($new_user->getDisplayName(), $name, 'Username matches.');
     $this->assertEqual($new_user->getEmail(), $mail, 'Email address matches.');
     $this->assertTrue(($new_user->getCreatedTime() > REQUEST_TIME - 20 ), 'Correct creation time.');
     $this->assertEqual($new_user->isActive(), $config_user_settings->get('register') == USER_REGISTER_VISITORS ? 1 : 0, 'Correct status field.');
@@ -275,9 +275,9 @@ function testRegistrationDefaultValues() {
   public function testUniqueFields() {
     $account = $this->drupalCreateUser();
 
-    $edit = ['mail' => 'test@example.com', 'name' => $account->getUsername()];
+    $edit = ['mail' => 'test@example.com', 'name' => $account->getDisplayName()];
     $this->drupalPostForm('user/register', $edit, t('Create new account'));
-    $this->assertRaw(SafeMarkup::format('The username %value is already taken.', ['%value' => $account->getUsername()]));
+    $this->assertRaw(SafeMarkup::format('The username %value is already taken.', ['%value' => $account->getDisplayName()]));
 
     $edit = ['mail' => $account->getEmail(), 'name' => $this->randomString()];
     $this->drupalPostForm('user/register', $edit, t('Create new account'));
diff --git a/core/modules/user/src/Tests/UserSearchTest.php b/core/modules/user/src/Tests/UserSearchTest.php
index d154030..6b5b91a 100644
--- a/core/modules/user/src/Tests/UserSearchTest.php
+++ b/core/modules/user/src/Tests/UserSearchTest.php
@@ -38,7 +38,7 @@ function testUserSearch() {
     $this->assertText('no results', 'Non-matching search gave appropriate message');
 
     // Verify that a user with search permission can search for users by name.
-    $keys = $user1->getUsername();
+    $keys = $user1->getDisplayName();
     $edit = array('keys' => $keys);
     $this->drupalPostForm('search/user', $edit, t('Search'));
     $this->assertLink($keys, 0, 'Search by username worked for non-admin user');
@@ -63,23 +63,23 @@ function testUserSearch() {
     $edit = array('keys' => $keys);
     $this->drupalPostForm('search/user', $edit, t('Search'));
     $this->assertText($keys, 'Search by email works for administrative user');
-    $this->assertText($user2->getUsername(), 'Search by email resulted in username on page for administrative user');
+    $this->assertText($user2->getDisplayName(), 'Search by email resulted in username on page for administrative user');
 
     // Verify that a substring works too for email.
     $subkey = substr($keys, 1, 5);
     $edit = array('keys' => $subkey);
     $this->drupalPostForm('search/user', $edit, t('Search'));
     $this->assertText($keys, 'Search by email substring works for administrative user');
-    $this->assertText($user2->getUsername(), 'Search by email substring resulted in username on page for administrative user');
+    $this->assertText($user2->getDisplayName(), 'Search by email substring resulted in username on page for administrative user');
 
     // Verify that wildcard search works for email
     $subkey = substr($keys, 0, 2) . '*' . substr($keys, 4, 2);
     $edit = array('keys' => $subkey);
     $this->drupalPostForm('search/user', $edit, t('Search'));
-    $this->assertText($user2->getUsername(), 'Search for email wildcard resulted in username on page for administrative user');
+    $this->assertText($user2->getDisplayName(), 'Search for email wildcard resulted in username on page for administrative user');
 
     // Verify that if they search by user name, they see email address too.
-    $keys = $user1->getUsername();
+    $keys = $user1->getDisplayName();
     $edit = array('keys' => $keys);
     $this->drupalPostForm('search/user', $edit, t('Search'));
     $this->assertText($keys, 'Search by username works for admin user');
@@ -92,14 +92,14 @@ function testUserSearch() {
 
     // Verify that users with "administer users" permissions can see blocked
     // accounts in search results.
-    $edit = array('keys' => $blocked_user->getUsername());
+    $edit = array('keys' => $blocked_user->getDisplayName());
     $this->drupalPostForm('search/user', $edit, t('Search'));
-    $this->assertText($blocked_user->getUsername(), 'Blocked users are listed on the user search results for users with the "administer users" permission.');
+    $this->assertText($blocked_user->getDisplayName(), 'Blocked users are listed on the user search results for users with the "administer users" permission.');
 
     // Verify that users without "administer users" permissions do not see
     // blocked accounts in search results.
     $this->drupalLogin($user1);
-    $edit = array('keys' => $blocked_user->getUsername());
+    $edit = array('keys' => $blocked_user->getDisplayName());
     $this->drupalPostForm('search/user', $edit, t('Search'));
     $this->assertText(t('Your search yielded no results.'), 'Blocked users are hidden from the user search results.');
 
diff --git a/core/modules/user/src/Tests/Views/ArgumentValidateTest.php b/core/modules/user/src/Tests/Views/ArgumentValidateTest.php
index 0a49142..b5ff580 100644
--- a/core/modules/user/src/Tests/Views/ArgumentValidateTest.php
+++ b/core/modules/user/src/Tests/Views/ArgumentValidateTest.php
@@ -64,7 +64,7 @@ public function testArgumentValidateUserName() {
     $view = Views::getView('test_view_argument_validate_username');
     $this->executeView($view);
 
-    $this->assertTrue($view->argument['null']->validateArgument($account->getUsername()));
+    $this->assertTrue($view->argument['null']->validateArgument($account->getDisplayName()));
     // Reset argument validation.
     $view->argument['null']->argument_validated = NULL;
     // Fail for a valid string, but for a user that doesn't exist
diff --git a/core/modules/user/tests/modules/user_access_test/user_access_test.module b/core/modules/user/tests/modules/user_access_test/user_access_test.module
index 470a76a..2567481 100644
--- a/core/modules/user/tests/modules/user_access_test/user_access_test.module
+++ b/core/modules/user/tests/modules/user_access_test/user_access_test.module
@@ -12,11 +12,11 @@
  * Implements hook_ENTITY_TYPE_access() for entity type "user".
  */
 function user_access_test_user_access(User $entity, $operation, $account) {
-  if ($entity->getUsername() == "no_edit" && $operation == "update") {
+  if ($entity->getDisplayName() == "no_edit" && $operation == "update") {
     // Deny edit access.
     return AccessResult::forbidden();
   }
-  if ($entity->getUsername() == "no_delete" && $operation == "delete") {
+  if ($entity->getDisplayName() == "no_delete" && $operation == "delete") {
     // Deny delete access.
     return AccessResult::forbidden();
   }
diff --git a/core/modules/user/tests/src/Functional/UserLoginHttpTest.php b/core/modules/user/tests/src/Functional/UserLoginHttpTest.php
index 3565441..7d72599 100644
--- a/core/modules/user/tests/src/Functional/UserLoginHttpTest.php
+++ b/core/modules/user/tests/src/Functional/UserLoginHttpTest.php
@@ -101,7 +101,7 @@ public function testLogin() {
         // Grant the user administer users permissions to they can see the
         // 'roles' field.
         $account = $this->drupalCreateUser(['administer users']);
-        $name = $account->getUsername();
+        $name = $account->getDisplayName();
         $pass = $account->passRaw;
 
         $login_status_url = $this->getLoginStatusUrlString($format);
@@ -228,12 +228,12 @@ public function testGlobalLoginFloodControl() {
 
     // Try 2 failed logins.
     for ($i = 0; $i < 2; $i++) {
-      $response = $this->loginRequest($incorrect_user->getUsername(), $incorrect_user->passRaw);
+      $response = $this->loginRequest($incorrect_user->getDisplayName(), $incorrect_user->passRaw);
       $this->assertEquals('400', $response->getStatusCode());
     }
 
     // IP limit has reached to its limit. Even valid user credentials will fail.
-    $response = $this->loginRequest($user->getUsername(), $user->passRaw);
+    $response = $this->loginRequest($user->getDisplayName(), $user->passRaw);
     $this->assertHttpResponseWithMessage($response, '403', 'Access is blocked because of IP based flood prevention.');
   }
 
@@ -292,18 +292,18 @@ public function testPerUserLoginFloodControl() {
 
       // Try 2 failed logins.
       for ($i = 0; $i < 2; $i++) {
-        $response = $this->loginRequest($incorrect_user1->getUsername(), $incorrect_user1->passRaw);
+        $response = $this->loginRequest($incorrect_user1->getDisplayName(), $incorrect_user1->passRaw);
         $this->assertHttpResponseWithMessage($response, 400, 'Sorry, unrecognized username or password.');
       }
 
       // A successful login will reset the per-user flood control count.
-      $response = $this->loginRequest($user1->getUsername(), $user1->passRaw);
+      $response = $this->loginRequest($user1->getDisplayName(), $user1->passRaw);
       $result_data = $this->serializer->decode($response->getBody(), 'json');
       $this->logoutRequest('json', $result_data['logout_token']);
 
       // Try 3 failed logins for user 1, they will not trigger flood control.
       for ($i = 0; $i < 3; $i++) {
-        $response = $this->loginRequest($incorrect_user1->getUsername(), $incorrect_user1->passRaw);
+        $response = $this->loginRequest($incorrect_user1->getDisplayName(), $incorrect_user1->passRaw);
         $this->assertHttpResponseWithMessage($response, 400, 'Sorry, unrecognized username or password.');
       }
 
@@ -314,7 +314,7 @@ public function testPerUserLoginFloodControl() {
 
       // Try one more attempt for user 1, it should be rejected, even if the
       // correct password has been used.
-      $response = $this->loginRequest($user1->getUsername(), $user1->passRaw);
+      $response = $this->loginRequest($user1->getDisplayName(), $user1->passRaw);
       // Depending on the uid_only setting the error message will be different.
       if ($uid_only_setting) {
         $excepted_message = 'There have been more than 3 failed login attempts for this account. It is temporarily blocked. Try again later or request a new password.';
@@ -366,7 +366,7 @@ public function testLogoutCsrfProtection() {
     $client = \Drupal::httpClient();
     $login_status_url = $this->getLoginStatusUrlString();
     $account = $this->drupalCreateUser();
-    $name = $account->getUsername();
+    $name = $account->getDisplayName();
     $pass = $account->passRaw;
 
     $response = $this->loginRequest($name, $pass);
diff --git a/core/modules/user/tests/src/Kernel/Migrate/MigrateUserAdminPassTest.php b/core/modules/user/tests/src/Kernel/Migrate/MigrateUserAdminPassTest.php
index 85cd761..9daf502 100644
--- a/core/modules/user/tests/src/Kernel/Migrate/MigrateUserAdminPassTest.php
+++ b/core/modules/user/tests/src/Kernel/Migrate/MigrateUserAdminPassTest.php
@@ -94,14 +94,14 @@ public function testAdminPasswordPreserved() {
     // Verify that admin username and email were changed, but password was not.
     /** @var \Drupal\user\Entity\User $admin_account */
     $admin_account = User::load(1);
-    $this->assertIdentical($admin_account->getUsername(), 'site_admin');
+    $this->assertIdentical($admin_account->getDisplayName(), 'site_admin');
     $this->assertIdentical($admin_account->getEmail(), 'site_admin@example.com');
     $this->assertIdentical($admin_account->getPassword(), $this->originalPasswords[1]);
 
     // Verify that everything changed for the regular user.
     /** @var \Drupal\user\Entity\User $user_account */
     $user_account = User::load(2);
-    $this->assertIdentical($user_account->getUsername(), 'random_user');
+    $this->assertIdentical($user_account->getDisplayName(), 'random_user');
     $this->assertIdentical($user_account->getEmail(), 'random_user@example.com');
     $this->assertNotIdentical($user_account->getPassword(), $this->originalPasswords[2]);
   }
diff --git a/core/modules/user/user.module b/core/modules/user/user.module
index 1e9f539..05ec582 100644
--- a/core/modules/user/user.module
+++ b/core/modules/user/user.module
@@ -389,7 +389,7 @@ function user_user_view_alter(array &$build, UserInterface $account, EntityViewD
     foreach (Element::children($build['user_picture']) as $key) {
       $item = $build['user_picture'][$key]['#item'];
       if (!$item->get('alt')->getValue()) {
-        $item->get('alt')->setValue(\Drupal::translation()->translate('Profile picture for user @username', ['@username' => $account->getUsername()]));
+        $item->get('alt')->setValue(\Drupal::translation()->translate('Profile picture for user @username', ['@username' => $account->getDisplayName()]));
       }
     }
   }
@@ -472,7 +472,7 @@ function template_preprocess_username(&$variables) {
   // their own shortening logic or add markup. If they do so, they must ensure
   // that $variables['name'] is safe for printing.
   $name  = $account->getDisplayName();
-  $variables['name_raw'] = $account->getUsername();
+  $variables['name_raw'] = $account->getDisplayName();
   if (Unicode::strlen($name) > 20) {
     $name = Unicode::truncate($name, 15, FALSE, TRUE);
     $variables['truncated'] = TRUE;
@@ -529,7 +529,7 @@ function template_preprocess_username(&$variables) {
  */
 function user_login_finalize(UserInterface $account) {
   \Drupal::currentUser()->setAccount($account);
-  \Drupal::logger('user')->notice('Session opened for %name.', array('%name' => $account->getUsername()));
+  \Drupal::logger('user')->notice('Session opened for %name.', array('%name' => $account->getDisplayName()));
   // Update the user table timestamp noting user has logged in.
   // This is also used to invalidate one-time login links.
   $account->setLastLoginTime(REQUEST_TIME);
@@ -1260,7 +1260,7 @@ function user_form_process_password_confirm($element) {
       'fair' => t('Fair'),
       'good' => t('Good'),
       'strong' => t('Strong'),
-      'username' => \Drupal::currentUser()->getUsername(),
+      'username' => \Drupal::currentUser()->getDisplayName(),
     );
   }
 
