3 namespace Drupal\FunctionalTests\Installer;
6 * Verifies that the early installer uses the correct language direction.
10 class InstallerLanguageDirectionTest extends InstallerTestBase {
13 * Overrides the language code the installer should use.
17 protected $langcode = 'ar';
22 protected function setUpLanguage() {
23 // Place a custom local translation in the translations directory.
24 mkdir($this->root . '/' . $this->siteDirectory . '/files/translations', 0777, TRUE);
25 file_put_contents($this->root . '/' . $this->siteDirectory . '/files/translations/drupal-8.0.0.ar.po', "msgid \"\"\nmsgstr \"\"\nmsgid \"Save and continue\"\nmsgstr \"Save and continue Arabic\"");
27 parent::setUpLanguage();
28 // After selecting a different language than English, all following screens
29 // should be translated already.
30 $elements = $this->xpath('//input[@type="submit"]/@value');
31 $this->assertEqual(current($elements)->getText(), 'Save and continue Arabic');
32 $this->translations['Save and continue'] = 'Save and continue Arabic';
34 // Verify that language direction is right-to-left.
35 $direction = current($this->xpath('/@dir'))->getText();
36 $this->assertEqual($direction, 'rtl');
40 * Confirms that the installation succeeded.
42 public function testInstalled() {
43 $this->assertUrl('user/1');
44 $this->assertResponse(200);