You are here

protected function LingotekSystemSiteExistingBulkTranslationTest::setUp in Lingotek Translation 8

Throws

\Exception

Overrides LingotekTestBase::setUp

File

src/Tests/LingotekSystemSiteExistingBulkTranslationTest.php, line 29

Class

LingotekSystemSiteExistingBulkTranslationTest
Tests translating a config object using the bulk management form.

Namespace

Drupal\lingotek\Tests

Code

protected function setUp() {
  parent::setUp();

  // Login as admin.
  $this
    ->drupalLogin($this->rootUser);

  // Add a language.
  $language = ConfigurableLanguage::createFromLangcode('es')
    ->setThirdPartySetting('lingotek', 'locale', 'es_MX');
  $language
    ->save();

  // This is a hack for avoiding writing different lingotek endpoint mocks.
  \Drupal::state()
    ->set('lingotek.uploaded_content_type', 'system.site');

  // Create a translation for system.site object.
  $config = \Drupal::languageManager()
    ->getLanguageConfigOverride('es', 'system.site');
  $config
    ->set('name', 'Translated Site Name')
    ->save();
}