Skip to content
Snippets Groups Projects

Issue #3208489: Allow overriding the login button label in UiHelperTrait::drupalLogin

@@ -242,10 +242,12 @@ protected function drupalPostForm($path, $edit, $submit, array $options = [], $f
*
* @param \Drupal\Core\Session\AccountInterface $account
* User object representing the user to log in.
* @param string $login_button_label
* The login button label.
*
* @see drupalCreateUser()
*/
protected function drupalLogin(AccountInterface $account) {
protected function drupalLogin(AccountInterface $account, string $login_button_label = 'Log in') {
if ($this->loggedInUser) {
$this->drupalLogout();
}
@@ -254,7 +256,7 @@ protected function drupalLogin(AccountInterface $account) {
$this->submitForm([
'name' => $account->getAccountName(),
'pass' => $account->passRaw,
], 'Log in');
], $login_button_label);
// @see ::drupalUserIsLoggedIn()
$account->sessionId = $this->getSession()->getCookie(\Drupal::service('session_configuration')->getOptions(\Drupal::request())['name']);
Loading