You are here

protected function TaxonomyTranslationTestTrait::enableTranslation in Drupal 8

Same name in this branch
  1. 8 core/modules/taxonomy/src/Tests/TaxonomyTranslationTestTrait.php \Drupal\taxonomy\Tests\TaxonomyTranslationTestTrait::enableTranslation()
  2. 8 core/modules/taxonomy/tests/src/Functional/TaxonomyTranslationTestTrait.php \Drupal\Tests\taxonomy\Functional\TaxonomyTranslationTestTrait::enableTranslation()
Same name and namespace in other branches
  1. 9 core/modules/taxonomy/tests/src/Functional/TaxonomyTranslationTestTrait.php \Drupal\Tests\taxonomy\Functional\TaxonomyTranslationTestTrait::enableTranslation()

Enables translations where it needed.

2 calls to TaxonomyTranslationTestTrait::enableTranslation()
TermTranslationFieldViewTest::setUp in core/modules/taxonomy/tests/src/Functional/TermTranslationFieldViewTest.php
TermTranslationTest::setUp in core/modules/taxonomy/tests/src/Functional/TermTranslationTest.php

File

core/modules/taxonomy/tests/src/Functional/TaxonomyTranslationTestTrait.php, line 63

Class

TaxonomyTranslationTestTrait
Provides common testing base for translated taxonomy terms.

Namespace

Drupal\Tests\taxonomy\Functional

Code

protected function enableTranslation() {

  // Enable translation for the current entity type and ensure the change is
  // picked up.
  \Drupal::service('content_translation.manager')
    ->setEnabled('node', 'article', TRUE);
  \Drupal::service('content_translation.manager')
    ->setEnabled('taxonomy_term', $this->vocabulary
    ->id(), TRUE);
}