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