You are here

protected function EncryptUserTest::setUp in Field Encryption 3.0.x

@TODO: Simplify setUp() by extending EncryptTestBase when https://www.drupal.org/node/2692387 lands.

File

tests/src/Functional/EncryptUserTest.php, line 38

Class

EncryptUserTest
Tests user field encryption.

Namespace

Drupal\Tests\field_encrypt\Functional

Code

protected function setUp() {
  parent::setUp();

  // Create an admin user.
  $this->adminUser = $this
    ->drupalCreateUser([
    'access administration pages',
    'administer encrypt',
    'administer keys',
    'administer field encryption',
  ], NULL, TRUE);

  // Set a value for init so it gets encrypted.
  $this->adminUser->init = 'test@example.com';
  $this->adminUser
    ->save();
  $this
    ->drupalLogin($this->adminUser);
  $this
    ->config('field_encrypt.settings')
    ->set('encryption_profile', 'encryption_profile_1')
    ->save();
}