function LocaleUpdateBase::setUp

Same name and namespace in other branches
  1. 10 core/modules/locale/tests/src/Functional/LocaleUpdateBase.php \Drupal\Tests\locale\Functional\LocaleUpdateBase::setUp()
  2. 11.x core/modules/locale/tests/src/Functional/LocaleUpdateBase.php \Drupal\Tests\locale\Functional\LocaleUpdateBase::setUp()
  3. 8.9.x core/modules/locale/tests/src/Functional/LocaleUpdateBase.php \Drupal\Tests\locale\Functional\LocaleUpdateBase::setUp()
1 method overrides LocaleUpdateBase::setUp()
LocaleTranslationDownloadTest::setUp in core/modules/locale/tests/src/Functional/LocaleTranslationDownloadTest.php

File

core/modules/locale/tests/src/Functional/LocaleUpdateBase.php, line 55

Class

LocaleUpdateBase
Base class for testing updates to string translations.

Namespace

Drupal\Tests\locale\Functional

Code

protected function setUp() {
  parent::setUp();
  // Setup timestamps to identify old and new translation sources.
  $this->timestampOld = REQUEST_TIME - 300;
  $this->timestampMedium = REQUEST_TIME - 200;
  $this->timestampNew = REQUEST_TIME - 100;
  $this->timestampNow = REQUEST_TIME;
  // Enable import of translations. By default this is disabled for automated
  // tests.
  $this->config('locale.settings')
    ->set('translation.import_enabled', TRUE)
    ->set('translation.use_source', LOCALE_TRANSLATION_USE_SOURCE_LOCAL)
    ->save();
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.