function ContentTranslationTestBase::setupLanguages

Same name in other branches
  1. 9 core/modules/content_translation/tests/src/Functional/ContentTranslationTestBase.php \Drupal\Tests\content_translation\Functional\ContentTranslationTestBase::setupLanguages()
  2. 8.9.x core/modules/content_translation/src/Tests/ContentTranslationTestBase.php \Drupal\content_translation\Tests\ContentTranslationTestBase::setupLanguages()
  3. 8.9.x core/modules/content_translation/tests/src/Functional/ContentTranslationTestBase.php \Drupal\Tests\content_translation\Functional\ContentTranslationTestBase::setupLanguages()
  4. 11.x core/modules/content_translation/tests/src/Functional/ContentTranslationTestBase.php \Drupal\Tests\content_translation\Functional\ContentTranslationTestBase::setupLanguages()

Adds additional languages.

1 call to ContentTranslationTestBase::setupLanguages()
ContentTranslationTestBase::doSetup in core/modules/content_translation/tests/src/Functional/ContentTranslationTestBase.php
Completes preparation for content translation tests.

File

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

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());
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.