public function LingotekUserSettingsBulkTranslationTest::testUserSettingsTranslationUsingActions in Lingotek Translation 4.0.x
Same name and namespace in other branches
- 8.2 tests/src/Functional/LingotekUserSettingsBulkTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekUserSettingsBulkTranslationTest::testUserSettingsTranslationUsingActions()
- 3.0.x tests/src/Functional/LingotekUserSettingsBulkTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekUserSettingsBulkTranslationTest::testUserSettingsTranslationUsingActions()
- 3.1.x tests/src/Functional/LingotekUserSettingsBulkTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekUserSettingsBulkTranslationTest::testUserSettingsTranslationUsingActions()
- 3.2.x tests/src/Functional/LingotekUserSettingsBulkTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekUserSettingsBulkTranslationTest::testUserSettingsTranslationUsingActions()
- 3.3.x tests/src/Functional/LingotekUserSettingsBulkTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekUserSettingsBulkTranslationTest::testUserSettingsTranslationUsingActions()
- 3.4.x tests/src/Functional/LingotekUserSettingsBulkTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekUserSettingsBulkTranslationTest::testUserSettingsTranslationUsingActions()
- 3.5.x tests/src/Functional/LingotekUserSettingsBulkTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekUserSettingsBulkTranslationTest::testUserSettingsTranslationUsingActions()
- 3.6.x tests/src/Functional/LingotekUserSettingsBulkTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekUserSettingsBulkTranslationTest::testUserSettingsTranslationUsingActions()
- 3.7.x tests/src/Functional/LingotekUserSettingsBulkTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekUserSettingsBulkTranslationTest::testUserSettingsTranslationUsingActions()
- 3.8.x tests/src/Functional/LingotekUserSettingsBulkTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekUserSettingsBulkTranslationTest::testUserSettingsTranslationUsingActions()
Tests that a config can be translated using the actions on the management page.
File
- tests/
src/ Functional/ LingotekUserSettingsBulkTranslationTest.php, line 87
Class
- LingotekUserSettingsBulkTranslationTest
- Tests translating user settings using the bulk management form.
Namespace
Drupal\Tests\lingotek\FunctionalCode
public function testUserSettingsTranslationUsingActions() {
$assert_session = $this
->assertSession();
// Login as admin.
$this
->drupalLogin($this->rootUser);
// Add a language.
ConfigurableLanguage::createFromLangcode('de')
->setThirdPartySetting('lingotek', 'locale', 'de_AT')
->save();
// Go to the bulk config management page.
$this
->goToConfigBulkManagementForm();
$basepath = \Drupal::request()
->getBasePath();
// I can init the upload of content.
$assert_session
->linkByHrefExists($basepath . '/admin/lingotek/config/upload/entity.user.admin_form/entity.user.admin_form?destination=' . $basepath . '/admin/lingotek/config/manage');
$edit = [
'table[entity.user.admin_form]' => TRUE,
$this
->getBulkOperationFormName() => $this
->getBulkOperationNameForUpload('node'),
];
$this
->drupalPostForm(NULL, $edit, $this
->getApplyActionsButtonLabel());
$this
->assertIdentical('en_US', \Drupal::state()
->get('lingotek.uploaded_locale'));
// I can check current status.
$assert_session
->linkByHrefExists($basepath . '/admin/lingotek/config/check_upload/entity.user.admin_form/entity.user.admin_form?destination=' . $basepath . '/admin/lingotek/config/manage');
$edit = [
'table[entity.user.admin_form]' => TRUE,
$this
->getBulkOperationFormName() => $this
->getBulkOperationNameForCheckUpload('node'),
];
$this
->drupalPostForm(NULL, $edit, $this
->getApplyActionsButtonLabel());
// Request the German (AT) translation.
$assert_session
->linkByHrefExists($basepath . '/admin/lingotek/config/request/entity.user.admin_form/entity.user.admin_form/de_AT?destination=' . $basepath . '/admin/lingotek/config/manage');
$edit = [
'table[entity.user.admin_form]' => TRUE,
$this
->getBulkOperationFormName() => $this
->getBulkOperationNameForRequestTranslation('de', 'node'),
];
$this
->drupalPostForm(NULL, $edit, $this
->getApplyActionsButtonLabel());
$this
->assertIdentical('de_AT', \Drupal::state()
->get('lingotek.added_target_locale'));
// Check status of the Spanish translation.
$assert_session
->linkByHrefExists($basepath . '/admin/lingotek/config/check_download/entity.user.admin_form/entity.user.admin_form/de_AT?destination=' . $basepath . '/admin/lingotek/config/manage');
$edit = [
'table[entity.user.admin_form]' => TRUE,
$this
->getBulkOperationFormName() => 'check_translation:de',
];
$this
->drupalPostForm(NULL, $edit, $this
->getApplyActionsButtonLabel());
$this
->assertIdentical('de_AT', \Drupal::state()
->get('lingotek.checked_target_locale'));
// Download the German translation.
$assert_session
->linkByHrefExists($basepath . '/admin/lingotek/config/download/entity.user.admin_form/entity.user.admin_form/de_AT?destination=' . $basepath . '/admin/lingotek/config/manage');
$edit = [
'table[entity.user.admin_form]' => TRUE,
$this
->getBulkOperationFormName() => 'download:de',
];
$this
->drupalPostForm(NULL, $edit, $this
->getApplyActionsButtonLabel());
$this
->assertIdentical('de_AT', \Drupal::state()
->get('lingotek.downloaded_locale'));
// Now the link is to the workbench, and it opens in a new tab.
$this
->assertLingotekWorkbenchLink('de_AT', 'dummy-document-hash-id', 'DE');
}