You are here

protected function TfaTestCase::testEncryption in Two-factor Authentication (TFA) 7.2

Test TfaBasePlugin encryption methods.

File

tests/tfa.test, line 382
Drupal test cases for TFA.

Class

TfaTestCase
Tests the functionality of the TFA module.

Code

protected function testEncryption() {
  $tfa_totp = new TfaTestTotp(array(
    'uid' => 1,
  ));
  $plain_text = $this
    ->randomName(rand(6, 20));
  $tfa_totp
    ->setInStore($plain_text);
  $this
    ->assertIdentical($plain_text, $tfa_totp
    ->readFromStore());
}