function InstallerTranslationMultipleLanguageTest::setUpLanguage

Same name in other branches
  1. 9 core/tests/Drupal/FunctionalTests/Installer/InstallerTranslationMultipleLanguageTest.php \Drupal\FunctionalTests\Installer\InstallerTranslationMultipleLanguageTest::setUpLanguage()
  2. 8.9.x core/tests/Drupal/FunctionalTests/Installer/InstallerTranslationMultipleLanguageTest.php \Drupal\FunctionalTests\Installer\InstallerTranslationMultipleLanguageTest::setUpLanguage()
  3. 10 core/tests/Drupal/FunctionalTests/Installer/InstallerTranslationMultipleLanguageTest.php \Drupal\FunctionalTests\Installer\InstallerTranslationMultipleLanguageTest::setUpLanguage()

Overrides InstallerTestBase::setUpLanguage

1 call to InstallerTranslationMultipleLanguageTest::setUpLanguage()
InstallerTranslationMultipleLanguageForeignTest::setUpLanguage in core/tests/Drupal/FunctionalTests/Installer/InstallerTranslationMultipleLanguageForeignTest.php
1 method overrides InstallerTranslationMultipleLanguageTest::setUpLanguage()
InstallerTranslationMultipleLanguageForeignTest::setUpLanguage in core/tests/Drupal/FunctionalTests/Installer/InstallerTranslationMultipleLanguageForeignTest.php

File

core/tests/Drupal/FunctionalTests/Installer/InstallerTranslationMultipleLanguageTest.php, line 29

Class

InstallerTranslationMultipleLanguageTest
Tests translation files for multiple languages get imported during install.

Namespace

Drupal\FunctionalTests\Installer

Code

protected function setUpLanguage() : void {
    // Place custom local translations in the translations directory.
    mkdir(DRUPAL_ROOT . '/' . $this->siteDirectory . '/files/translations', 0777, TRUE);
    file_put_contents(DRUPAL_ROOT . '/' . $this->siteDirectory . '/files/translations/drupal-8.0.0.de.po', $this->getPo('de'));
    file_put_contents(DRUPAL_ROOT . '/' . $this->siteDirectory . '/files/translations/drupal-8.0.0.es.po', $this->getPo('es'));
    parent::setUpLanguage();
}

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