diff --git a/core/modules/simpletest/src/WebTestBase.php b/core/modules/simpletest/src/WebTestBase.php index a9f7ad0..cde113c 100644 --- a/core/modules/simpletest/src/WebTestBase.php +++ b/core/modules/simpletest/src/WebTestBase.php @@ -335,7 +335,7 @@ protected function drupalLogin(AccountInterface $account) { } $edit = array( - 'name' => $account->getDisplayName(), + 'name' => $account->getAccountName(), 'pass' => $account->pass_raw ); $this->drupalPostForm('user/login', $edit, t('Log in')); @@ -344,7 +344,7 @@ protected function drupalLogin(AccountInterface $account) { if (isset($this->sessionId)) { $account->session_id = $this->sessionId; } - $pass = $this->assert($this->drupalUserIsLoggedIn($account), format_string('User %account successfully logged in.', array('%account' => $account->getAccountName())), 'User login'); + $pass = $this->assert($this->drupalUserIsLoggedIn($account), new FormattableMarkup('User %name successfully logged in.', array('%name' => $account->getDisplayName())), 'User login'); if ($pass) { $this->loggedInUser = $account; $this->container->get('current_user')->setAccount($account); diff --git a/core/modules/user/src/Tests/UserLoginTest.php b/core/modules/user/src/Tests/UserLoginTest.php index 2d66fc7..e79faff 100644 --- a/core/modules/user/src/Tests/UserLoginTest.php +++ b/core/modules/user/src/Tests/UserLoginTest.php @@ -156,7 +156,7 @@ function testPasswordRehashOnLogin() { */ function assertFailedLogin($account, $flood_trigger = NULL) { $edit = array( - 'name' => $account->getDisplayName(), + 'name' => $account->getAccountName(), 'pass' => $account->pass_raw, ); $this->drupalPostForm('user/login', $edit, t('Log in')); diff --git a/core/tests/Drupal/Tests/BrowserTestBase.php b/core/tests/Drupal/Tests/BrowserTestBase.php index eac054f..b7649128 100644 --- a/core/tests/Drupal/Tests/BrowserTestBase.php +++ b/core/tests/Drupal/Tests/BrowserTestBase.php @@ -716,13 +716,13 @@ protected function drupalLogin(AccountInterface $account) { $this->drupalGet('user/login'); $this->assertSession()->statusCodeEquals(200); $this->submitForm(array( - 'name' => $account->getDisplayName(), + 'name' => $account->getAccountName(), 'pass' => $account->passRaw, ), t('Log in')); // @see BrowserTestBase::drupalUserIsLoggedIn() $account->sessionId = $this->getSession()->getCookie($this->getSessionName()); - $this->assertTrue($this->drupalUserIsLoggedIn($account), new FormattableMarkup('User %name successfully logged in.', array('%name' => $account->getAccountName()))); + $this->assertTrue($this->drupalUserIsLoggedIn($account), new FormattableMarkup('User %name successfully logged in.', array('%name' => $account->getDisplayName()))); $this->loggedInUser = $account; $this->container->get('current_user')->setAccount($account);