You are here

protected function LocaleTranslationDownloadTest::setUp in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/locale/tests/src/Functional/LocaleTranslationDownloadTest.php \Drupal\Tests\locale\Functional\LocaleTranslationDownloadTest::setUp()

Overrides LocaleUpdateBase::setUp

File

core/modules/locale/tests/src/Functional/LocaleTranslationDownloadTest.php, line 31

Class

LocaleTranslationDownloadTest
Tests locale translation download.

Namespace

Drupal\Tests\locale\Functional

Code

protected function setUp() {
  parent::setUp();
  $moduleHandler = $this->container
    ->get('module_handler');
  $moduleHandler
    ->loadInclude('locale', 'inc', 'locale.batch');
  ConfigurableLanguage::createFromLangcode('de')
    ->save();

  // Let the translations:// stream wrapper point to a virtual file system to
  // make it independent from the test environment.
  $this->translationsStream = vfsStream::setup('translations');
  \Drupal::configFactory()
    ->getEditable('locale.settings')
    ->set('translation.path', $this->translationsStream
    ->url())
    ->save();
}