You are here

protected function EntityReferenceFieldTranslatedReferenceViewTest::enableTranslation in Drupal 8

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

Enables translations where it needed.

1 call to EntityReferenceFieldTranslatedReferenceViewTest::enableTranslation()
EntityReferenceFieldTranslatedReferenceViewTest::setUp in core/modules/field/tests/src/Functional/EntityReference/EntityReferenceFieldTranslatedReferenceViewTest.php

File

core/modules/field/tests/src/Functional/EntityReference/EntityReferenceFieldTranslatedReferenceViewTest.php, line 227

Class

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

Namespace

Drupal\Tests\field\Functional\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::service('router.builder')
    ->rebuild();
}