class InstallerTranslationExistingFileTest
Same name and namespace in other branches
- 11.x core/tests/Drupal/FunctionalTests/Installer/InstallerTranslationExistingFileTest.php \Drupal\FunctionalTests\Installer\InstallerTranslationExistingFileTest
Tests translation files for multiple languages get imported during install.
@group Installer
Hierarchy
- class \Drupal\Tests\BrowserTestBase uses \Drupal\Core\Test\FunctionalTestSetupTrait, \Drupal\Tests\UiHelperTrait, \Drupal\Core\Test\TestSetupTrait, \Drupal\Tests\block\Traits\BlockCreationTrait, \Drupal\FunctionalTests\AssertLegacyTrait, \Drupal\Tests\RandomGeneratorTrait, \Drupal\Tests\node\Traits\NodeCreationTrait, \Drupal\Tests\node\Traits\ContentTypeCreationTrait, \Drupal\Tests\ConfigTestTrait, \Drupal\Tests\TestRequirementsTrait, \Drupal\Tests\user\Traits\UserCreationTrait, \Drupal\Tests\XdebugRequestTrait, \Drupal\Tests\Traits\PhpUnitWarnings, \Drupal\Tests\PhpUnitCompatibilityTrait, \Symfony\Bridge\PhpUnit\ExpectDeprecationTrait, \Drupal\Tests\ExtensionListTestTrait implements \PHPUnit\Framework\TestCase
- class \Drupal\FunctionalTests\Installer\InstallerTestBase uses \Drupal\Tests\RequirementsPageTrait implements \Drupal\Tests\BrowserTestBase
- class \Drupal\FunctionalTests\Installer\InstallerTranslationExistingFileTest implements \Drupal\FunctionalTests\Installer\InstallerTestBase
- class \Drupal\FunctionalTests\Installer\InstallerTestBase uses \Drupal\Tests\RequirementsPageTrait implements \Drupal\Tests\BrowserTestBase
Expanded class hierarchy of InstallerTranslationExistingFileTest
File
-
core/
tests/ Drupal/ FunctionalTests/ Installer/ InstallerTranslationExistingFileTest.php, line 10
Namespace
Drupal\FunctionalTests\InstallerView source
class InstallerTranslationExistingFileTest extends InstallerTestBase {
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';
/**
* Overrides the language code in which to install Drupal.
*
* Choose one of the smaller languages on ftp.drupal.org. There is no way to
* avoid using ftp.drupal.org since the code being tested runs extremely early
* in the installer. However, even if the call to ftp.drupal.org fails then
* this test will not fail as it will end up on the requirements page.
*
* @var string
*/
protected $langcode = 'xx-lolspeak';
/**
* {@inheritdoc}
*/
protected function setUpLanguage() {
// Place custom local translations in the translations directory.
mkdir(DRUPAL_ROOT . '/' . $this->siteDirectory . '/files/translations', 0777, TRUE);
$po_contents = <<<ENDPO
msgid ""
msgstr ""
ENDPO;
// Create a misnamed translation file that
// \Drupal\Core\StringTranslation\Translator\FileTranslation::findTranslationFiles()
// will not find.
file_put_contents(DRUPAL_ROOT . '/' . $this->siteDirectory . '/files/translations/drupal-8.0.0-DEV.xx-lolspeak.po', $po_contents);
parent::setUpLanguage();
}
/**
* {@inheritdoc}
*/
protected function setUpProfile() {
// Do nothing, because this test only tests the language installation
// step's results.
}
/**
* {@inheritdoc}
*/
protected function setUpSettings() {
// Do nothing, because this test only tests the language installation
// step's results.
}
/**
* {@inheritdoc}
*/
protected function setUpRequirementsProblem() {
// Do nothing, because this test only tests the language installation
// step's results.
}
/**
* {@inheritdoc}
*/
protected function setUpSite() {
// Do nothing, because this test only tests the language installation
// step's results.
}
/**
* Ensures language selection has not failed.
*/
public function testInstall() {
// At this point we'll be on the profile selection or requirements screen.
$this->assertSession()
->statusCodeEquals(200);
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.