function TaxonomyTranslationTestTrait::enableTranslation
Same name in other branches
- 9 core/modules/taxonomy/tests/src/Functional/TaxonomyTranslationTestTrait.php \Drupal\Tests\taxonomy\Functional\TaxonomyTranslationTestTrait::enableTranslation()
- 8.9.x core/modules/taxonomy/src/Tests/TaxonomyTranslationTestTrait.php \Drupal\taxonomy\Tests\TaxonomyTranslationTestTrait::enableTranslation()
- 8.9.x core/modules/taxonomy/tests/src/Functional/TaxonomyTranslationTestTrait.php \Drupal\Tests\taxonomy\Functional\TaxonomyTranslationTestTrait::enableTranslation()
- 11.x core/modules/taxonomy/tests/src/Functional/TaxonomyTranslationTestTrait.php \Drupal\Tests\taxonomy\Functional\TaxonomyTranslationTestTrait::enableTranslation()
Enables translations where it needed.
3 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 - TermTranslationViewsTest::setUp in core/
modules/ taxonomy/ tests/ src/ Functional/ Views/ TermTranslationViewsTest.php - Sets up the test.
File
-
core/
modules/ taxonomy/ tests/ src/ Functional/ TaxonomyTranslationTestTrait.php, line 65
Class
- TaxonomyTranslationTestTrait
- Provides common testing base for translated taxonomy terms.
Namespace
Drupal\Tests\taxonomy\FunctionalCode
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);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.