You are here

protected function EntityReferenceFieldTranslatedReferenceViewTest::enableTranslation in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/modules/field/src/Tests/EntityReference/EntityReferenceFieldTranslatedReferenceViewTest.php \Drupal\field\Tests\EntityReference\EntityReferenceFieldTranslatedReferenceViewTest::enableTranslation()

Enables translations where it needed.

1 call to EntityReferenceFieldTranslatedReferenceViewTest::enableTranslation()
EntityReferenceFieldTranslatedReferenceViewTest::setUp in core/modules/field/src/Tests/EntityReference/EntityReferenceFieldTranslatedReferenceViewTest.php
Sets up a Drupal site for running functional and integration tests.

File

core/modules/field/src/Tests/EntityReference/EntityReferenceFieldTranslatedReferenceViewTest.php, line 194
Contains \Drupal\field\Tests\EntityReference\EntityReferenceFieldTranslatedReferenceViewTest.

Class

EntityReferenceFieldTranslatedReferenceViewTest
Tests the translation of entity reference field display on nodes.

Namespace

Drupal\field\Tests\EntityReference

Code

protected function enableTranslation() {

  // Enable translation for the entity types and ensure the change is picked
  // up.
  \Drupal::service('content_translation.manager')
    ->setEnabled($this->testEntityTypeName, $this->referrerType
    ->id(), TRUE);
  \Drupal::service('content_translation.manager')
    ->setEnabled($this->testEntityTypeName, $this->referencedType
    ->id(), TRUE);
  drupal_static_reset();
  \Drupal::entityManager()
    ->clearCachedDefinitions();
  \Drupal::service('router.builder')
    ->rebuild();
  \Drupal::service('entity.definition_update_manager')
    ->applyUpdates();
}