function UserValidateCurrentPassCustomForm::testUserValidateCurrentPassCustomForm

7.x user.test UserValidateCurrentPassCustomForm::testUserValidateCurrentPassCustomForm()

Tests that user_validate_current_pass can be reused on a custom form.

File

drupal-7.x/modules/user/user.test, line 2358
Tests for user.module.

Class

UserValidateCurrentPassCustomForm
Tests user_validate_current_pass on a custom form.

Code

function testUserValidateCurrentPassCustomForm() {
  $this->drupalLogin($this->adminUser);

  // Submit the custom form with the admin user using the access user's password.
  $edit = array();
  $edit['user_form_test_field'] = $this->accessUser->name;
  $edit['current_pass'] = $this->accessUser->pass_raw;
  $this->drupalPost('user_form_test_current_password/' . $this->accessUser->uid, $edit, t('Test'));
  $this->assertText(t('The password has been validated and the form submitted successfully.'));
}