diff --git a/core/modules/user/src/Tests/UserEditTest.php b/core/modules/user/src/Tests/UserEditTest.php index aaef855..83c7ecd 100644 --- a/core/modules/user/src/Tests/UserEditTest.php +++ b/core/modules/user/src/Tests/UserEditTest.php @@ -119,13 +119,13 @@ function testUserEditWithConflicts() { // Test that the first user can save their account with no errors. $this->drupalLogin($user_with_email); - $this->drupalPost("user/$user_with_email->uid/edit", array(), t('Save')); + $this->drupalPostForm("user/" . $user_with_email->id() . "/edit", array(), t('Save')); $this->assertText(t("The changes have been saved."), "The user does not need to change their username if it matches another user's email address."); $this->drupalLogout(); // Test that the second user can save their account with no errors. $this->drupalLogin($user_with_name); - $this->drupalPost("user/$user_with_name->uid/edit", array(), t('Save')); + $this->drupalPostForm("user/" . $user_with_name->id() . "/edit", array(), t('Save')); $this->assertText(t("The changes have been saved."), "The user does not need to change their email address if it matches another user's username."); } } diff --git a/core/modules/user/src/Tests/UserPasswordResetTest.php b/core/modules/user/src/Tests/UserPasswordResetTest.php index 66be438..3146596 100644 --- a/core/modules/user/src/Tests/UserPasswordResetTest.php +++ b/core/modules/user/src/Tests/UserPasswordResetTest.php @@ -75,20 +75,20 @@ protected function setUp() { * Attempts to reset a password when an email address matches two accounts. */ function testUserPasswordResetDuplicateUsers() { - $user_settings = \Drupal::config('user.settings'); + $user_settings = $this->config('user.settings'); + // Don't require email validation for new accounts. - $user_settings->set('verify_mail', FALSE); + $user_settings->set('verify_mail', FALSE)->save(); // Don't require admin approval for new accounts. - $user_settings->set('register', USER_REGISTER_VISITORS); - $user_settings->save(); + $user_settings->set('register', USER_REGISTER_VISITORS)->save(); // Create two users. $user_with_email = $this->drupalCreateUser(); $user_with_name = $this->drupalCreateUser(); // Change the second user's username to the same value as the first user's // email address. - $user_with_name->name = $user_with_email->mail; + $user_with_name->name = $user_with_email->mail; $user_with_name->save(); // Try and reset based on the duplicated email. diff --git a/core/modules/user/src/Tests/UserRegistrationTest.php b/core/modules/user/src/Tests/UserRegistrationTest.php index 7bcdcbc..cacce6e 100644 --- a/core/modules/user/src/Tests/UserRegistrationTest.php +++ b/core/modules/user/src/Tests/UserRegistrationTest.php @@ -156,13 +156,12 @@ function testRegistrationEmailDuplicates() { * existing user's username. */ function testRegistrationConflicts() { - $user_settings = \Drupal::config('user.settings'); + $user_settings = $this->config('user.settings'); // Don't require email validation for new accounts. - $user_settings->set('verify_mail', FALSE); + $user_settings->set('verify_mail', FALSE)->save(); // Don't require admin approval for new accounts. - $user_settings->set('register', USER_REGISTER_VISITORS); - $user_settings->save(); + $user_settings->set('register', USER_REGISTER_VISITORS)->save(); // Set up a user to check for duplicates. $duplicate_user = $this->drupalCreateUser();