InstallerLanguageDirectionTest.php in Drupal 9
File
core/tests/Drupal/FunctionalTests/Installer/InstallerLanguageDirectionTest.php
View source
<?php
namespace Drupal\FunctionalTests\Installer;
class InstallerLanguageDirectionTest extends InstallerTestBase {
protected $defaultTheme = 'stark';
protected $langcode = 'ar';
protected function setUpLanguage() {
mkdir($this->root . '/' . $this->siteDirectory . '/files/translations', 0777, TRUE);
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\"");
parent::setUpLanguage();
$this
->assertSession()
->buttonExists('Save and continue Arabic');
$this->translations['Save and continue'] = 'Save and continue Arabic';
$direction = current($this
->xpath('/@dir'))
->getText();
$this
->assertEquals('rtl', $direction);
}
public function testInstalled() {
$this
->assertSession()
->addressEquals('user/1');
$this
->assertSession()
->statusCodeEquals(200);
}
}