Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / tests / Drupal / FunctionalTests / Installer / InstallerLanguagePageTest.php
diff --git a/web/core/tests/Drupal/FunctionalTests/Installer/InstallerLanguagePageTest.php b/web/core/tests/Drupal/FunctionalTests/Installer/InstallerLanguagePageTest.php
new file mode 100644 (file)
index 0000000..5ea9692
--- /dev/null
@@ -0,0 +1,44 @@
+<?php
+
+namespace Drupal\FunctionalTests\Installer;
+
+use Drupal\Core\Language\LanguageManager;
+
+/**
+ * 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($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->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);
+  }
+
+}