TestSiteMultilingualInstallTestScript.php 793 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. namespace Drupal\TestSite;
  3. /**
  4. * Setup file used by TestSiteApplicationTest.
  5. *
  6. * @see \Drupal\Tests\Scripts\TestSiteApplicationTest
  7. */
  8. class TestSiteMultilingualInstallTestScript implements TestSetupInterface, TestPreinstallInterface {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function preinstall($db_prefix, $site_directory) {
  13. // Place a custom local translation in the translations directory.
  14. mkdir($site_directory . '/files/translations', 0777, TRUE);
  15. file_put_contents($site_directory . '/files/translations/drupal-8.0.0.fr.po', "msgid \"\"\nmsgstr \"\"\nmsgid \"Save and continue\"\nmsgstr \"Enregistrer et continuer\"");
  16. }
  17. /**
  18. * {@inheritdoc}
  19. */
  20. public function setup() {
  21. \Drupal::service('module_installer')->install(['test_page_test']);
  22. }
  23. }