You are here

protected function LingotekTargetActionsTest::setUp in Lingotek Translation 3.8.x

Same name and namespace in other branches
  1. 4.0.x tests/src/FunctionalJavascript/LingotekTargetActionsTest.php \Drupal\Tests\lingotek\FunctionalJavascript\LingotekTargetActionsTest::setUp()
  2. 3.6.x tests/src/FunctionalJavascript/LingotekTargetActionsTest.php \Drupal\Tests\lingotek\FunctionalJavascript\LingotekTargetActionsTest::setUp()
  3. 3.7.x tests/src/FunctionalJavascript/LingotekTargetActionsTest.php \Drupal\Tests\lingotek\FunctionalJavascript\LingotekTargetActionsTest::setUp()

Overrides LingotekFunctionalJavascriptTestBase::setUp

File

tests/src/FunctionalJavascript/LingotekTargetActionsTest.php, line 22

Class

LingotekTargetActionsTest
@group lingotek

Namespace

Drupal\Tests\lingotek\FunctionalJavascript

Code

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

  // Place the actions and title block.
  $this
    ->drupalPlaceBlock('page_title_block', [
    'region' => 'content',
    'weight' => -5,
  ]);
  $this
    ->drupalPlaceBlock('local_tasks_block', [
    'region' => 'content',
    'weight' => -10,
  ]);
  $this
    ->drupalCreateContentType([
    'type' => 'article',
    'name' => 'Article',
  ]);

  // Add locales.
  ConfigurableLanguage::createFromLangcode('es')
    ->setThirdPartySetting('lingotek', 'locale', 'es_ES')
    ->save();
  ConfigurableLanguage::createFromLangcode('it')
    ->setThirdPartySetting('lingotek', 'locale', 'it_IT')
    ->save();

  // Enable translation for the current entity type and ensure the change is
  // picked up.
  ContentLanguageSettings::loadByEntityTypeBundle('node', 'article')
    ->setLanguageAlterable(TRUE)
    ->save();
  \Drupal::service('content_translation.manager')
    ->setEnabled('node', 'article', TRUE);
  $this
    ->saveLingotekContentTranslationSettingsForNodeTypes();
}