Mercurial > hg > isophonics-drupal-site
diff core/modules/system/src/Tests/Installer/InstallerLanguagePageTest.php @ 0:4c8ae668cc8c
Initial import (non-working)
author | Chris Cannam |
---|---|
date | Wed, 29 Nov 2017 16:09:58 +0000 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/modules/system/src/Tests/Installer/InstallerLanguagePageTest.php Wed Nov 29 16:09:58 2017 +0000 @@ -0,0 +1,45 @@ +<?php + +namespace Drupal\system\Tests\Installer; + +use Drupal\Core\Language\LanguageManager; +use Drupal\simpletest\InstallerTestBase; + +/** + * Verifies that the installer language list combines local and remote languages. + * + * @group Installer + */ +class InstallerLanguagePageTest extends InstallerTestBase { + + /** + * Installer step: Select language. + */ + protected function setUpLanguage() { + // Place a custom local translation in the translations directory. + mkdir(\Drupal::root() . '/' . $this->siteDirectory . '/files/translations', 0777, TRUE); + touch(\Drupal::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->assertOption('edit-langcode', $langcode); + $this->assertRaw('>' . $names[1] . '<'); + } + + // Check that our custom one shows up with the file name indicated language. + $this->assertOption('edit-langcode', 'xoxo'); + $this->assertRaw('>xoxo<'); + + parent::setUpLanguage(); + } + + /** + * Confirms that the installation succeeded. + */ + public function testInstalled() { + $this->assertUrl('user/1'); + $this->assertResponse(200); + } + +}