ce3d1ecac25f65dc4df3df82fd65dfb6a044f131
[yaffs-website] / web / core / modules / system / src / Tests / Installer / InstallerLanguagePageTest.php
1 <?php
2
3 namespace Drupal\system\Tests\Installer;
4
5 use Drupal\Core\Language\LanguageManager;
6 use Drupal\simpletest\InstallerTestBase;
7
8 /**
9  * Verifies that the installer language list combines local and remote languages.
10  *
11  * @group Installer
12  */
13 class InstallerLanguagePageTest extends InstallerTestBase {
14
15   /**
16    * Installer step: Select language.
17    */
18   protected function setUpLanguage() {
19     // Place a custom local translation in the translations directory.
20     mkdir(\Drupal::root() . '/' . $this->siteDirectory . '/files/translations', 0777, TRUE);
21     touch(\Drupal::root() . '/' . $this->siteDirectory . '/files/translations/drupal-8.0.0.xoxo.po');
22
23     // Check that all predefined languages show up with their native names.
24     $this->visitInstaller();
25     foreach (LanguageManager::getStandardLanguageList() as $langcode => $names) {
26       $this->assertOption('edit-langcode', $langcode);
27       $this->assertRaw('>' . $names[1] . '<');
28     }
29
30     // Check that our custom one shows up with the file name indicated language.
31     $this->assertOption('edit-langcode', 'xoxo');
32     $this->assertRaw('>xoxo<');
33
34     parent::setUpLanguage();
35   }
36
37   /**
38    * Confirms that the installation succeeded.
39    */
40   public function testInstalled() {
41     $this->assertUrl('user/1');
42     $this->assertResponse(200);
43   }
44
45 }