You are here

function LocaleSourceTest::setUp in Translation Management Tool 8

Overrides TMGMTKernelTestBase::setUp

File

sources/locale/tests/src/Kernel/LocaleSourceTest.php, line 26

Class

LocaleSourceTest
Basic Locale Source tests.

Namespace

Drupal\Tests\tmgmt_locale\Kernel

Code

function setUp() : void {
  parent::setUp();
  $this->langcode = 'de';
  $this->context = 'default';
  \Drupal::service('router.builder')
    ->rebuild();
  $this
    ->installSchema('locale', array(
    'locales_source',
    'locales_target',
  ));
  $file = new \stdClass();
  $file->uri = \Drupal::service('file_system')
    ->realpath(drupal_get_path('module', 'tmgmt_locale') . '/tests/test.xx.po');
  $file->langcode = $this->langcode;
  Gettext::fileToDatabase($file, array());
  $this
    ->addLanguage('es');
}