protected function KeyChangeTest::setFieldStorageSettings 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 KeyChangeTest::setFieldStorageSettings()
- KeyChangeTest::testEncryptionProfileChange in tests/
src/ Functional/ KeyChangeTest.php - Tests...
File
- tests/
src/ Functional/ KeyChangeTest.php, line 66
Class
- KeyChangeTest
- Tests changing encryption profiles.
Namespace
Drupal\Tests\field_encrypt\FunctionalCode
protected function setFieldStorageSettings($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();
}