protected function EncryptingExistingDataTest::setBaseFieldStorageSettings in Field Encryption 3.0.x
Set up base fields for test.
Parameters
bool $encryption: Whether or not the fields should be encrypted. Defaults to TRUE.
1 call to EncryptingExistingDataTest::setBaseFieldStorageSettings()
- EncryptingExistingDataTest::testEncryptingExistingData in tests/
src/ Functional/ EncryptingExistingDataTest.php - Tests that existing entities can be encrypted.
File
- tests/
src/ Functional/ EncryptingExistingDataTest.php, line 178
Class
- EncryptingExistingDataTest
- Tests encrypting fields on entities that already exist.
Namespace
Drupal\Tests\field_encrypt\FunctionalCode
protected function setBaseFieldStorageSettings($encryption = TRUE) {
// Set up storage settings for first field.
$this
->drupalGet('admin/config/system/field-encrypt/entity-types');
$this
->assertSession()
->fieldExists('entity_type')
->selectOption('Content');
$this
->submitForm([], 'Save configuration');
if ($encryption) {
$this
->assertSession()
->fieldExists('base_fields[title]')
->check();
}
else {
$this
->assertSession()
->fieldExists('base_fields[title]')
->uncheck();
}
$this
->submitForm([], 'Save configuration');
$this
->assertSession()
->pageTextContains('Updated encryption settings for Content base fields.');
$this
->rebuildAll();
}