X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Fsystem%2Fsrc%2FTests%2FInstaller%2FDistributionProfileTranslationQueryTest.php;fp=web%2Fcore%2Fmodules%2Fsystem%2Fsrc%2FTests%2FInstaller%2FDistributionProfileTranslationQueryTest.php;h=0000000000000000000000000000000000000000;hp=85b1e44ec43cab49b9922495b1cc70d19c40d717;hb=0bf8d09d2542548982e81a441b1f16e75873a04f;hpb=74df008bdbb3a11eeea356744f39b802369bda3c diff --git a/web/core/modules/system/src/Tests/Installer/DistributionProfileTranslationQueryTest.php b/web/core/modules/system/src/Tests/Installer/DistributionProfileTranslationQueryTest.php deleted file mode 100644 index 85b1e44ec..000000000 --- a/web/core/modules/system/src/Tests/Installer/DistributionProfileTranslationQueryTest.php +++ /dev/null @@ -1,142 +0,0 @@ -info = [ - 'type' => 'profile', - 'core' => \Drupal::CORE_COMPATIBILITY, - 'name' => 'Distribution profile', - 'distribution' => [ - 'name' => 'My Distribution', - 'langcode' => $this->langcode, - 'install' => [ - 'theme' => 'bartik', - ], - ], - ]; - // File API functions are not available yet. - $path = $this->siteDirectory . '/profiles/mydistro'; - mkdir($path, 0777, TRUE); - file_put_contents("$path/mydistro.info.yml", Yaml::encode($this->info)); - - parent::setUp(); - } - - /** - * {@inheritdoc} - */ - protected function visitInstaller() { - // Place a custom local translation in the translations directory. - mkdir(\Drupal::root() . '/' . $this->siteDirectory . '/files/translations', 0777, TRUE); - file_put_contents(\Drupal::root() . '/' . $this->siteDirectory . '/files/translations/drupal-8.0.0.de.po', $this->getPo('de')); - file_put_contents(\Drupal::root() . '/' . $this->siteDirectory . '/files/translations/drupal-8.0.0.fr.po', $this->getPo('fr')); - - // Pass a different language code than the one set in the distribution - // profile. This distribution language should still be used. - // The unrouted URL assembler does not exist at this point, so we build the - // URL ourselves. - $this->drupalGet($GLOBALS['base_url'] . '/core/install.php' . '?langcode=fr'); - } - - /** - * {@inheritdoc} - */ - protected function setUpLanguage() { - // This step is skipped, because the distribution profile uses a fixed - // language. - } - - /** - * {@inheritdoc} - */ - protected function setUpProfile() { - // This step is skipped, because there is a distribution profile. - } - - /** - * {@inheritdoc} - */ - protected function setUpSettings() { - // The language should have been automatically detected, all following - // screens should be translated already. - $elements = $this->xpath('//input[@type="submit"]/@value'); - $this->assertEqual((string) current($elements), 'Save and continue de'); - $this->translations['Save and continue'] = 'Save and continue de'; - - // Check the language direction. - $direction = (string) current($this->xpath('/html/@dir')); - $this->assertEqual($direction, 'ltr'); - - // Verify that the distribution name appears. - $this->assertRaw($this->info['distribution']['name']); - // Verify that the requested theme is used. - $this->assertRaw($this->info['distribution']['install']['theme']); - // Verify that the "Choose profile" step does not appear. - $this->assertNoText('profile'); - - parent::setUpSettings(); - } - - /** - * Confirms that the installation succeeded. - */ - public function testInstalled() { - $this->assertUrl('user/1'); - $this->assertResponse(200); - - // Confirm that we are logged-in after installation. - $this->assertText($this->rootUser->getDisplayName()); - - // Verify German was configured but not English. - $this->drupalGet('admin/config/regional/language'); - $this->assertText('German'); - $this->assertNoText('English'); - } - - /** - * Returns the string for the test .po file. - * - * @param string $langcode - * The language code. - * @return string - * Contents for the test .po file. - */ - protected function getPo($langcode) { - return <<