diff --git a/core/modules/system/src/Tests/Installer/InstallerLanguageDirectionTest.php b/core/modules/system/src/Tests/Installer/InstallerLanguageDirectionTest.php index 74b8be2..cd7bce5 100644 --- a/core/modules/system/src/Tests/Installer/InstallerLanguageDirectionTest.php +++ b/core/modules/system/src/Tests/Installer/InstallerLanguageDirectionTest.php @@ -27,17 +27,16 @@ class InstallerLanguageDirectionTest extends InstallerTestBase { * {@inheritdoc} */ protected function setUpLanguage() { + // Place a custom local translation 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.ar.po', "msgid \"\"\nmsgstr \"\"\nmsgid \"Save and continue\"\nmsgstr \"Save and continue Arabic\""); + parent::setUpLanguage(); // After selecting a different language than English, all following screens // should be translated already. - // @todo Instead of actually downloading random translations that cannot be - // asserted, write and supply a translation file. Until then, take - // over whichever string happens to be there, but ensure that the English - // string no longer appears. $elements = $this->xpath('//input[@type="submit"]/@value'); - $string = (string) current($elements); - $this->assertNotEqual($string, 'Save and continue'); - $this->translations['Save and continue'] = $string; + $this->assertEqual((string) current($elements), 'Save and continue Arabic'); + $this->translations['Save and continue'] = 'Save and continue Arabic'; // Verify that language direction is right-to-left. $direction = (string) current($this->xpath('/html/@dir')); diff --git a/core/modules/system/src/Tests/Installer/InstallerTranslationTest.php b/core/modules/system/src/Tests/Installer/InstallerTranslationTest.php index 8ebf010..5a24f27 100644 --- a/core/modules/system/src/Tests/Installer/InstallerTranslationTest.php +++ b/core/modules/system/src/Tests/Installer/InstallerTranslationTest.php @@ -28,17 +28,16 @@ class InstallerTranslationTest extends InstallerTestBase { * Overrides InstallerTest::setUpLanguage(). */ protected function setUpLanguage() { + // Place a custom local translation 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', "msgid \"\"\nmsgstr \"\"\nmsgid \"Save and continue\"\nmsgstr \"Save and continue German\""); + parent::setUpLanguage(); // After selecting a different language than English, all following screens // should be translated already. - // @todo Instead of actually downloading random translations that cannot be - // asserted, write and supply a German translation file. Until then, take - // over whichever string happens to be there, but ensure that the English - // string no longer appears. $elements = $this->xpath('//input[@type="submit"]/@value'); - $string = (string) current($elements); - $this->assertNotEqual($string, 'Save and continue'); - $this->translations['Save and continue'] = $string; + $this->assertEqual((string) current($elements), 'Save and continue German'); + $this->translations['Save and continue'] = 'Save and continue German'; // Check the language direction. $direction = (string) current($this->xpath('/html/@dir'));