class TestSiteMultilingualInstallTestScript in Drupal 9
Same name and namespace in other branches
- 8 core/tests/Drupal/TestSite/TestSiteMultilingualInstallTestScript.php \Drupal\TestSite\TestSiteMultilingualInstallTestScript
Setup file used by TestSiteApplicationTest.
Hierarchy
- class \Drupal\TestSite\TestSiteMultilingualInstallTestScript implements TestPreinstallInterface, TestSetupInterface
Expanded class hierarchy of TestSiteMultilingualInstallTestScript
See also
\Drupal\Tests\Scripts\TestSiteApplicationTest
File
- core/
tests/ Drupal/ TestSite/ TestSiteMultilingualInstallTestScript.php, line 10
Namespace
Drupal\TestSiteView source
class TestSiteMultilingualInstallTestScript implements TestSetupInterface, TestPreinstallInterface {
/**
* {@inheritdoc}
*/
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\"");
}
/**
* {@inheritdoc}
*/
public function setup() {
\Drupal::service('module_installer')
->install([
'test_page_test',
]);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
TestSiteMultilingualInstallTestScript:: |
public | function |
Runs code prior to a test site install. Overrides TestPreinstallInterface:: |
|
TestSiteMultilingualInstallTestScript:: |
public | function |
Run the code to setup the test environment. Overrides TestSetupInterface:: |