You are here

public function MassPasswordReset::testAdminUserMassPasswordReset in Mass Password Change 8

Test Password reset function for Admin (uid=1) user.

File

tests/src/Functional/MassPasswordReset.php, line 21

Class

MassPasswordReset
Test the password reset function.

Namespace

Drupal\Tests\mass_password_change\Functional

Code

public function testAdminUserMassPasswordReset() {
  $admin_user_weight = $this
    ->getUserWeightFromAccountsArray($this->accounts, 1);
  $this
    ->drupalGet('/admin/people');
  $edit = [
    'action' => 'mass_password_reset_action',
    "user_bulk_form[{$admin_user_weight}]" => TRUE,
  ];
  $this
    ->drupalPostForm(NULL, $edit, 'Apply to selected items');
  $this
    ->assertText('No access to execute Password reset the selected user(s) on the User admin.');
}