InstallerLanguagePageTest.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. namespace Drupal\FunctionalTests\Installer;
  3. use Drupal\Core\Language\LanguageManager;
  4. /**
  5. * Verifies that the installer language list combines local and remote languages.
  6. *
  7. * @group Installer
  8. */
  9. class InstallerLanguagePageTest extends InstallerTestBase {
  10. /**
  11. * {@inheritdoc}
  12. */
  13. protected $defaultTheme = 'stark';
  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. // Check that all predefined languages show up with their native names.
  22. $this->visitInstaller();
  23. foreach (LanguageManager::getStandardLanguageList() as $langcode => $names) {
  24. $this->assertOption('edit-langcode', $langcode);
  25. $this->assertRaw('>' . $names[1] . '<');
  26. }
  27. // Check that our custom one shows up with the file name indicated language.
  28. $this->assertOption('edit-langcode', 'xoxo');
  29. $this->assertRaw('>xoxo<');
  30. parent::setUpLanguage();
  31. }
  32. /**
  33. * Confirms that the installation succeeded.
  34. */
  35. public function testInstalled() {
  36. $this->assertUrl('user/1');
  37. $this->assertSession()->statusCodeEquals(200);
  38. }
  39. }