function LocaleNonInteractiveInstallTest::installParameters

Same name and namespace in other branches
  1. 8.9.x core/modules/locale/tests/src/Functional/LocaleNonInteractiveInstallTest.php \Drupal\Tests\locale\Functional\LocaleNonInteractiveInstallTest::installParameters()
  2. 10 core/modules/locale/tests/src/Functional/LocaleNonInteractiveInstallTest.php \Drupal\Tests\locale\Functional\LocaleNonInteractiveInstallTest::installParameters()
  3. 11.x core/modules/locale/tests/src/Functional/LocaleNonInteractiveInstallTest.php \Drupal\Tests\locale\Functional\LocaleNonInteractiveInstallTest::installParameters()

Overrides FunctionalTestSetupTrait::installParameters

File

core/modules/locale/tests/src/Functional/LocaleNonInteractiveInstallTest.php, line 34

Class

LocaleNonInteractiveInstallTest
Tests installing in a different language with a non-dev version string.

Namespace

Drupal\Tests\locale\Functional

Code

protected function installParameters() {
    $parameters = parent::installParameters();
    // Install Drupal in German.
    $parameters['parameters']['langcode'] = 'de';
    // Create a po file so we don't attempt to download one from
    // localize.drupal.org and to have a test translation that will not change.
    \Drupal::service('file_system')->mkdir($this->publicFilesDirectory . '/translations', NULL, TRUE);
    $contents = <<<ENDPO
msgid ""
msgstr ""

msgid "Enter the password that accompanies your username."
msgstr "Geben sie das Passwort für ihren Benutzernamen ein."

ENDPO;
    $version = $this->getVersionStringToTest();
    file_put_contents($this->publicFilesDirectory . "/translations/drupal-{$version}.de.po", $contents);
    return $parameters;
}

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