comparison 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
comparison
equal deleted inserted replaced
-1:000000000000 0:4c8ae668cc8c
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 }