X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Fsystem%2Fsrc%2FTests%2FInstaller%2FInstallerLanguageDirectionTest.php;fp=web%2Fcore%2Fmodules%2Fsystem%2Fsrc%2FTests%2FInstaller%2FInstallerLanguageDirectionTest.php;h=5e2c15a82d099abd5a103df8401fcb514d8e90f8;hb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;hp=0000000000000000000000000000000000000000;hpb=57c063afa3f66b07c4bbddc2d6129a96d90f0aad;p=yaffs-website diff --git a/web/core/modules/system/src/Tests/Installer/InstallerLanguageDirectionTest.php b/web/core/modules/system/src/Tests/Installer/InstallerLanguageDirectionTest.php new file mode 100644 index 000000000..5e2c15a82 --- /dev/null +++ b/web/core/modules/system/src/Tests/Installer/InstallerLanguageDirectionTest.php @@ -0,0 +1,49 @@ +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. + $elements = $this->xpath('//input[@type="submit"]/@value'); + $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')); + $this->assertEqual($direction, 'rtl'); + } + + /** + * Confirms that the installation succeeded. + */ + public function testInstalled() { + $this->assertUrl('user/1'); + $this->assertResponse(200); + } + +}