You are here

public function GALoginTotpValidationPluginTest::setUp in Google Authenticator login 8

Overrides TfaTestBase::setUp

File

tests/src/Functional/GALoginTotpValidationPluginTest.php, line 63

Class

GALoginTotpValidationPluginTest
Class GALoginTotpValidationPluginTest.

Namespace

Drupal\Tests\ga_login\Functional

Code

public function setUp() {
  parent::setUp();
  $this
    ->canEnableValidationPlugin($this->validationPluginId);
  $this->userAccount = $this
    ->drupalCreateUser([
    'setup own tfa',
    'disable own tfa',
  ]);
  $this->validationPlugin = \Drupal::service('plugin.manager.tfa.validation')
    ->createInstance($this->validationPluginId, [
    'uid' => $this->userAccount
      ->id(),
  ]);
  $this
    ->drupalLogin($this->userAccount);
  $this
    ->setupUserTotp();
  $this
    ->drupalLogout();
}