Mercurial > hg > isophonics-drupal-site
annotate core/modules/system/src/Tests/Installer/InstallerLanguagePageTest.php @ 12:7a779792577d
Update Drupal core to v8.4.5 (via Composer)
author | Chris Cannam |
---|---|
date | Fri, 23 Feb 2018 15:52:07 +0000 |
parents | 4c8ae668cc8c |
children |
rev | line source |
---|---|
Chris@0 | 1 <?php |
Chris@0 | 2 |
Chris@0 | 3 namespace Drupal\system\Tests\Installer; |
Chris@0 | 4 |
Chris@0 | 5 use Drupal\Core\Language\LanguageManager; |
Chris@0 | 6 use Drupal\simpletest\InstallerTestBase; |
Chris@0 | 7 |
Chris@0 | 8 /** |
Chris@0 | 9 * Verifies that the installer language list combines local and remote languages. |
Chris@0 | 10 * |
Chris@0 | 11 * @group Installer |
Chris@0 | 12 */ |
Chris@0 | 13 class InstallerLanguagePageTest extends InstallerTestBase { |
Chris@0 | 14 |
Chris@0 | 15 /** |
Chris@0 | 16 * Installer step: Select language. |
Chris@0 | 17 */ |
Chris@0 | 18 protected function setUpLanguage() { |
Chris@0 | 19 // Place a custom local translation in the translations directory. |
Chris@0 | 20 mkdir(\Drupal::root() . '/' . $this->siteDirectory . '/files/translations', 0777, TRUE); |
Chris@0 | 21 touch(\Drupal::root() . '/' . $this->siteDirectory . '/files/translations/drupal-8.0.0.xoxo.po'); |
Chris@0 | 22 |
Chris@0 | 23 // Check that all predefined languages show up with their native names. |
Chris@0 | 24 $this->visitInstaller(); |
Chris@0 | 25 foreach (LanguageManager::getStandardLanguageList() as $langcode => $names) { |
Chris@0 | 26 $this->assertOption('edit-langcode', $langcode); |
Chris@0 | 27 $this->assertRaw('>' . $names[1] . '<'); |
Chris@0 | 28 } |
Chris@0 | 29 |
Chris@0 | 30 // Check that our custom one shows up with the file name indicated language. |
Chris@0 | 31 $this->assertOption('edit-langcode', 'xoxo'); |
Chris@0 | 32 $this->assertRaw('>xoxo<'); |
Chris@0 | 33 |
Chris@0 | 34 parent::setUpLanguage(); |
Chris@0 | 35 } |
Chris@0 | 36 |
Chris@0 | 37 /** |
Chris@0 | 38 * Confirms that the installation succeeded. |
Chris@0 | 39 */ |
Chris@0 | 40 public function testInstalled() { |
Chris@0 | 41 $this->assertUrl('user/1'); |
Chris@0 | 42 $this->assertResponse(200); |
Chris@0 | 43 } |
Chris@0 | 44 |
Chris@0 | 45 } |