function InstallerLanguagePageTest::setUpLanguage
Same name in other branches
- 9 core/tests/Drupal/FunctionalTests/Installer/InstallerLanguagePageTest.php \Drupal\FunctionalTests\Installer\InstallerLanguagePageTest::setUpLanguage()
- 8.9.x core/tests/Drupal/FunctionalTests/Installer/InstallerLanguagePageTest.php \Drupal\FunctionalTests\Installer\InstallerLanguagePageTest::setUpLanguage()
- 11.x core/tests/Drupal/FunctionalTests/Installer/InstallerLanguagePageTest.php \Drupal\FunctionalTests\Installer\InstallerLanguagePageTest::setUpLanguage()
Installer step: Select language.
Overrides InstallerTestBase::setUpLanguage
File
-
core/
tests/ Drupal/ FunctionalTests/ Installer/ InstallerLanguagePageTest.php, line 26
Class
- InstallerLanguagePageTest
- Verifies that the installer language list combines local and remote languages.
Namespace
Drupal\FunctionalTests\InstallerCode
protected function setUpLanguage() {
// Place a custom local translation in the translations directory.
mkdir($this->root . '/' . $this->siteDirectory . '/files/translations', 0777, TRUE);
touch($this->root . '/' . $this->siteDirectory . '/files/translations/drupal-8.0.0.xoxo.po');
// Check that all predefined languages show up with their native names.
$this->visitInstaller();
foreach (LanguageManager::getStandardLanguageList() as $langcode => $names) {
$this->assertSession()
->optionExists('edit-langcode', $langcode);
$this->assertSession()
->responseContains('>' . $names[1] . '<');
}
// Check that our custom one shows up with the file name indicated language.
$this->assertSession()
->optionExists('edit-langcode', 'xoxo');
$this->assertSession()
->responseContains('>xoxo<');
parent::setUpLanguage();
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.