You are here

protected function TfaTestBase::generateEncryptionProfile in Two-factor Authentication (TFA) 8

Generates an Encryption profile.

1 call to TfaTestBase::generateEncryptionProfile()
TfaTestBase::setUp in tests/src/Functional/TfaTestBase.php

File

tests/src/Functional/TfaTestBase.php, line 79

Class

TfaTestBase
Base class for testing the Tfa module.

Namespace

Drupal\Tests\tfa\Functional

Code

protected function generateEncryptionProfile() {
  $encryption_profile = EncryptionProfile::create([
    'id' => 'test_encryption_profile',
    'label' => 'Test encryption profile',
    'encryption_method' => 'test_encryption_method',
    'encryption_key' => $this->testKey
      ->id(),
  ]);
  $encryption_profile
    ->save();
  $this->encryptionProfile = $encryption_profile;
}