You are here

protected function FieldEncryptTestBase::setTranslationSettings in Field Encryption 3.0.x

Same name and namespace in other branches
  1. 8.2 tests/src/Functional/FieldEncryptTestBase.php \Drupal\Tests\field_encrypt\Functional\FieldEncryptTestBase::setTranslationSettings()

Set up translation settings for content translation test.

1 call to FieldEncryptTestBase::setTranslationSettings()
ConfigurableFieldTest::testEncryptFieldTranslation in tests/src/Functional/ConfigurableFieldTest.php
Test encrypting fields with translations.

File

tests/src/Functional/FieldEncryptTestBase.php, line 189

Class

FieldEncryptTestBase
Base test class for field_encrypt.

Namespace

Drupal\Tests\field_encrypt\Functional

Code

protected function setTranslationSettings() {

  // Set up extra language.
  ConfigurableLanguage::createFromLangcode('fr')
    ->save();

  // Enable translation for the current entity type and ensure the change is
  // picked up.
  \Drupal::service('content_translation.manager')
    ->setEnabled('node', 'page', TRUE);
  drupal_static_reset();
  $this->entityTypeManager
    ->clearCachedDefinitions();
  \Drupal::service('router.builder')
    ->rebuild();
  $this
    ->rebuildContainer();
}