You are here

protected function ContentTranslationTestBase::setupLanguages in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/content_translation/src/Tests/ContentTranslationTestBase.php \Drupal\content_translation\Tests\ContentTranslationTestBase::setupLanguages()

Adds additional languages.

1 call to ContentTranslationTestBase::setupLanguages()
ContentTranslationTestBase::setUp in core/modules/content_translation/src/Tests/ContentTranslationTestBase.php
Sets up a Drupal site for running functional and integration tests.

File

core/modules/content_translation/src/Tests/ContentTranslationTestBase.php, line 107
Contains \Drupal\content_translation\Tests\ContentTranslationTestBase.

Class

ContentTranslationTestBase
Base class for content translation tests.

Namespace

Drupal\content_translation\Tests

Code

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