InstallerLanguagePageTest.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. * Installer step: Select language.
  12. */
  13. protected function setUpLanguage() {
  14. // Place a custom local translation in the translations directory.
  15. mkdir($this->root . '/' . $this->siteDirectory . '/files/translations', 0777, TRUE);
  16. touch($this->root . '/' . $this->siteDirectory . '/files/translations/drupal-8.0.0.xoxo.po');
  17. // Check that all predefined languages show up with their native names.
  18. $this->visitInstaller();
  19. foreach (LanguageManager::getStandardLanguageList() as $langcode => $names) {
  20. $this->assertOption('edit-langcode', $langcode);
  21. $this->assertRaw('>' . $names[1] . '<');
  22. }
  23. // Check that our custom one shows up with the file name indicated language.
  24. $this->assertOption('edit-langcode', 'xoxo');
  25. $this->assertRaw('>xoxo<');
  26. parent::setUpLanguage();
  27. }
  28. /**
  29. * Confirms that the installation succeeded.
  30. */
  31. public function testInstalled() {
  32. $this->assertUrl('user/1');
  33. $this->assertResponse(200);
  34. }
  35. }