You are here

protected function ContentTranslationTestBase::setupLanguages 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::setupLanguages()
  2. 9 core/modules/content_translation/tests/src/Functional/ContentTranslationTestBase.php \Drupal\Tests\content_translation\Functional\ContentTranslationTestBase::setupLanguages()

Adds additional languages.

File

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

Class

ContentTranslationTestBase
Base class for content translation tests.

Namespace

Drupal\Tests\content_translation\Functional

Code

protected function setupLanguages() {
  $this->langcodes = [
    'it',
    'fr',
  ];
  foreach ($this->langcodes as $langcode) {
    ConfigurableLanguage::createFromLangcode($langcode)
      ->save();
  }
  array_unshift($this->langcodes, \Drupal::languageManager()
    ->getDefaultLanguage()
    ->getId());
}