function InstallerTranslationMultipleLanguageNonInteractiveTest::prepareEnvironment

Same name in other branches
  1. 9 core/tests/Drupal/FunctionalTests/Installer/InstallerTranslationMultipleLanguageNonInteractiveTest.php \Drupal\FunctionalTests\Installer\InstallerTranslationMultipleLanguageNonInteractiveTest::prepareEnvironment()
  2. 11.x core/tests/Drupal/FunctionalTests/Installer/InstallerTranslationMultipleLanguageNonInteractiveTest.php \Drupal\FunctionalTests\Installer\InstallerTranslationMultipleLanguageNonInteractiveTest::prepareEnvironment()

Overrides FunctionalTestSetupTrait::prepareEnvironment

1 method overrides InstallerTranslationMultipleLanguageNonInteractiveTest::prepareEnvironment()
InstallerTranslationNonStandardFilenamesTest::prepareEnvironment in core/tests/Drupal/FunctionalTests/Installer/InstallerTranslationNonStandardFilenamesTest.php
Prepares the current environment for running the test.

File

core/tests/Drupal/FunctionalTests/Installer/InstallerTranslationMultipleLanguageNonInteractiveTest.php, line 33

Class

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

Namespace

Drupal\FunctionalTests\Installer

Code

protected function prepareEnvironment() {
    parent::prepareEnvironment();
    // 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'));
}

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