You are here

public function TestSiteMultilingualInstallTestScript::preinstall in Drupal 9

Same name and namespace in other branches
  1. 8 core/tests/Drupal/TestSite/TestSiteMultilingualInstallTestScript.php \Drupal\TestSite\TestSiteMultilingualInstallTestScript::preinstall()

Runs code prior to a test site install.

This method is run after FunctionalTestSetupTrait::prepareEnvironment() but before Drupal is installed. As such, there is limited setup of the environment and no Drupal API is available.

Parameters

string $db_prefix: The database prefix.

string $site_directory: The site directory.

Overrides TestPreinstallInterface::preinstall

See also

\Drupal\TestSite\TestSiteInstallTestScript

File

core/tests/Drupal/TestSite/TestSiteMultilingualInstallTestScript.php, line 15

Class

TestSiteMultilingualInstallTestScript
Setup file used by TestSiteApplicationTest.

Namespace

Drupal\TestSite

Code

public function preinstall($db_prefix, $site_directory) {

  // Place a custom local translation in the translations directory.
  mkdir($site_directory . '/files/translations', 0777, TRUE);
  file_put_contents($site_directory . '/files/translations/drupal-8.0.0.fr.po', "msgid \"\"\nmsgstr \"\"\nmsgid \"Save and continue\"\nmsgstr \"Enregistrer et continuer\"");
}