protected function TaxonomyTranslationTestTrait::enableTranslation in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/taxonomy/src/Tests/TaxonomyTranslationTestTrait.php \Drupal\taxonomy\Tests\TaxonomyTranslationTestTrait::enableTranslation()
Enables translations where it needed.
2 calls to TaxonomyTranslationTestTrait::enableTranslation()
- TermTranslationBreadcrumbTest::setUp in core/
modules/ taxonomy/ src/ Tests/ TermTranslationBreadcrumbTest.php - Sets up a Drupal site for running functional and integration tests.
- TermTranslationFieldViewTest::setUp in core/
modules/ taxonomy/ src/ Tests/ TermTranslationFieldViewTest.php - Sets up a Drupal site for running functional and integration tests.
File
- core/
modules/ taxonomy/ src/ Tests/ TaxonomyTranslationTestTrait.php, line 68 - Contains \Drupal\taxonomy\Tests\TaxonomyTranslationTestTrait.
Class
- TaxonomyTranslationTestTrait
- Provides common testing base for translated taxonomy terms.
Namespace
Drupal\taxonomy\TestsCode
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);
drupal_static_reset();
\Drupal::entityManager()
->clearCachedDefinitions();
\Drupal::service('router.builder')
->rebuild();
\Drupal::service('entity.definition_update_manager')
->applyUpdates();
}