You are here

protected function ContentTranslationTestBase::enableTranslation in Drupal 10

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

Enables translation for the current entity type and bundle.

File

core/modules/content_translation/tests/src/Functional/ContentTranslationTestBase.php, line 167

Class

ContentTranslationTestBase
Base class for content translation tests.

Namespace

Drupal\Tests\content_translation\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($this->entityTypeId, $this->bundle, TRUE);
}