public function LingotekUserSettingsBulkTranslationTest::testUserSettingsMultipleLanguageTranslationUsingActions in Lingotek Translation 8
Tests that a config object can be translated using the actions on the management page.
File
- src/
Tests/ LingotekUserSettingsBulkTranslationTest.php, line 213
Class
- LingotekUserSettingsBulkTranslationTest
- Tests translating user settings using the bulk management form.
Namespace
Drupal\lingotek\TestsCode
public function testUserSettingsMultipleLanguageTranslationUsingActions() {
// 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.
$this
->assertLinkByHref($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,
'operation' => 'upload',
];
$this
->drupalPostForm(NULL, $edit, t('Execute'));
// I can check current status.
$this
->assertLinkByHref($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,
'operation' => 'check_upload',
];
$this
->drupalPostForm(NULL, $edit, t('Execute'));
// Request all the translations.
$this
->assertLinkByHref($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,
'operation' => 'request_translations',
];
$this
->drupalPostForm(NULL, $edit, t('Execute'));
// Check status of all the translations.
$this
->assertLinkByHref($basepath . '/admin/lingotek/config/check_download/entity.user.admin_form/entity.user.admin_form/es_MX?destination=' . $basepath . '/admin/lingotek/config/manage');
$edit = [
'table[entity.user.admin_form]' => TRUE,
'operation' => 'check_translations',
];
$this
->drupalPostForm(NULL, $edit, t('Execute'));
// Download all the translations.
$this
->assertLinkByHref($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,
'operation' => 'download',
];
$this
->drupalPostForm(NULL, $edit, t('Execute'));
}