You are here

public function LingotekNodeTranslationAppendTypeTitleOptionTest::testProfileUseGlobalSettingsAppendTypeTitle in Lingotek Translation 3.6.x

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

Test to append type title by using the profile options defaulting to settings.

File

tests/src/Functional/LingotekNodeTranslationAppendTypeTitleOptionTest.php, line 207

Class

LingotekNodeTranslationAppendTypeTitleOptionTest
Tests the append type to document title option.

Namespace

Drupal\Tests\lingotek\Functional

Code

public function testProfileUseGlobalSettingsAppendTypeTitle() {
  $this
    ->setSettingsAppendTypeTitle(TRUE);
  $profile = LingotekProfile::create([
    'id' => 'custom',
    'label' => 'Profile with overrides',
    'auto_upload' => FALSE,
    'auto_download' => FALSE,
    'append_type_to_title' => 'global_setting',
  ]);
  $profile
    ->save();

  // Create a node.
  $edit = [];
  $edit['title[0][value]'] = 'Llamas are cool';
  $edit['body[0][value]'] = 'Llamas are very cool';
  $edit['langcode[0][value]'] = 'en';
  $edit['lingotek_translation_management[lingotek_translation_profile]'] = 'custom';
  $this
    ->saveAndPublishNodeForm($edit);
  $this
    ->goToContentBulkManagementForm();

  // Clicking English must init the upload of content.
  $this
    ->clickLink('EN');

  // Check that the title used was the right one.
  $uploaded_title = \Drupal::state()
    ->get('lingotek.uploaded_title');
  $this
    ->assertIdentical('article (node): Llamas are cool', $uploaded_title, 'The node title was used appending type.');
}