You are here

protected function LingotekTestBase::saveLingotekContentTranslationSettingsForNodeTypes in Lingotek Translation 3.6.x

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

Save Lingotek translation settings for node types.

Example:

$this
  ->saveLingotekContentTranslationSettingsForNodeTypes([
  'article',
  'page',
], manual);

Parameters

array $node_types: The node types we want to enable.

string $profile: The profile id we want to use.

46 calls to LingotekTestBase::saveLingotekContentTranslationSettingsForNodeTypes()
ChineseBulkTranslationTest::setUp in tests/src/Functional/ChineseBulkTranslationTest.php
LingotekActionsTest::testActionsCreatedWhenEnablingTranslations in tests/src/Functional/Actions/LingotekActionsTest.php
Tests that a node can be deleted in the management page.
LingotekBulkDeleteTest::setUp in tests/src/Functional/LingotekBulkDeleteTest.php
LingotekConfigBulkFormTest::setUp in tests/src/Functional/Form/LingotekConfigBulkFormTest.php
LingotekConfigDependenciesTest::testExportingConfigDependencies in tests/src/Functional/LingotekConfigDependenciesTest.php

... See full list

File

tests/src/Functional/LingotekTestBase.php, line 687

Class

LingotekTestBase
Base class for Lingotek test. Performs authorization of the account.

Namespace

Drupal\Tests\lingotek\Functional

Code

protected function saveLingotekContentTranslationSettingsForNodeTypes($node_types = [
  'article',
], $profile = 'automatic') {
  $settings = [];
  foreach ($node_types as $node_type) {
    $settings['node'][$node_type] = [
      'profiles' => $profile,
      'fields' => [
        'title' => 1,
        'body' => 1,
      ],
    ];
  }
  $this
    ->saveLingotekContentTranslationSettings($settings);
}