You are here

protected function LingotekConfigTranslationPreSaveHookTest::setUp in Lingotek Translation 3.1.x

Same name and namespace in other branches
  1. 8.2 tests/src/Functional/LingotekConfigTranslationPreSaveHookTest.php \Drupal\Tests\lingotek\Functional\LingotekConfigTranslationPreSaveHookTest::setUp()
  2. 4.0.x tests/src/Functional/LingotekConfigTranslationPreSaveHookTest.php \Drupal\Tests\lingotek\Functional\LingotekConfigTranslationPreSaveHookTest::setUp()
  3. 3.0.x tests/src/Functional/LingotekConfigTranslationPreSaveHookTest.php \Drupal\Tests\lingotek\Functional\LingotekConfigTranslationPreSaveHookTest::setUp()
  4. 3.2.x tests/src/Functional/LingotekConfigTranslationPreSaveHookTest.php \Drupal\Tests\lingotek\Functional\LingotekConfigTranslationPreSaveHookTest::setUp()
  5. 3.3.x tests/src/Functional/LingotekConfigTranslationPreSaveHookTest.php \Drupal\Tests\lingotek\Functional\LingotekConfigTranslationPreSaveHookTest::setUp()
  6. 3.4.x tests/src/Functional/LingotekConfigTranslationPreSaveHookTest.php \Drupal\Tests\lingotek\Functional\LingotekConfigTranslationPreSaveHookTest::setUp()
  7. 3.5.x tests/src/Functional/LingotekConfigTranslationPreSaveHookTest.php \Drupal\Tests\lingotek\Functional\LingotekConfigTranslationPreSaveHookTest::setUp()
  8. 3.6.x tests/src/Functional/LingotekConfigTranslationPreSaveHookTest.php \Drupal\Tests\lingotek\Functional\LingotekConfigTranslationPreSaveHookTest::setUp()
  9. 3.7.x tests/src/Functional/LingotekConfigTranslationPreSaveHookTest.php \Drupal\Tests\lingotek\Functional\LingotekConfigTranslationPreSaveHookTest::setUp()
  10. 3.8.x tests/src/Functional/LingotekConfigTranslationPreSaveHookTest.php \Drupal\Tests\lingotek\Functional\LingotekConfigTranslationPreSaveHookTest::setUp()

Overrides LingotekTestBase::setUp

File

tests/src/Functional/LingotekConfigTranslationPreSaveHookTest.php, line 22

Class

LingotekConfigTranslationPreSaveHookTest
Tests the Lingotek config translation pre save hook.

Namespace

Drupal\Tests\lingotek\Functional

Code

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

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

  // Enable translation for the current entity type and ensure the change is
  // picked up.
  $this
    ->saveLingotekConfigTranslationSettings([
    'block' => 'automatic',
  ]);

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