InstallerLanguageDirectionTest.php in Zircon Profile 8
File
core/modules/system/src/Tests/Installer/InstallerLanguageDirectionTest.php
View source
<?php
namespace Drupal\system\Tests\Installer;
use Drupal\simpletest\InstallerTestBase;
class InstallerLanguageDirectionTest extends InstallerTestBase {
protected $langcode = 'ar';
protected function setUpLanguage() {
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();
$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';
$direction = (string) current($this
->xpath('/html/@dir'));
$this
->assertEqual($direction, 'rtl');
}
public function testInstalled() {
$this
->assertUrl('user/1');
$this
->assertResponse(200);
}
}