public function LingotekContentTypeBulkDisabledTargetOverrideTranslationTest::testContentTypeTranslationUsingLinks in Lingotek Translation 3.8.x
Same name and namespace in other branches
- 4.0.x tests/src/Functional/LingotekContentTypeBulkDisabledTargetOverrideTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekContentTypeBulkDisabledTargetOverrideTranslationTest::testContentTypeTranslationUsingLinks()
- 3.7.x tests/src/Functional/LingotekContentTypeBulkDisabledTargetOverrideTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekContentTypeBulkDisabledTargetOverrideTranslationTest::testContentTypeTranslationUsingLinks()
Tests that a content type can be translated using the links on the management page.
File
- tests/
src/ Functional/ LingotekContentTypeBulkDisabledTargetOverrideTranslationTest.php, line 65
Class
- LingotekContentTypeBulkDisabledTargetOverrideTranslationTest
- Tests translating a content type using the bulk management form.
Namespace
Drupal\Tests\lingotek\FunctionalCode
public function testContentTypeTranslationUsingLinks() {
$assert_session = $this
->assertSession();
$basepath = \Drupal::request()
->getBasePath();
$this
->goToConfigBulkManagementForm('node_type');
// Clicking English must init the upload of content.
$assert_session
->linkByHrefExists($basepath . '/admin/lingotek/config/upload/node_type/article?destination=' . $basepath . '/admin/lingotek/config/manage');
// And we cannot request yet a translation.
$assert_session
->linkByHrefNotExists($basepath . '/admin/lingotek/config/request/node_type/article/es_MX?destination=' . $basepath . '/admin/lingotek/config/manage');
$assert_session
->linkByHrefNotExists($basepath . '/admin/lingotek/config/request/node_type/article/ca_ES?destination=' . $basepath . '/admin/lingotek/config/manage');
$this
->clickLink('EN');
$this
->assertText('Article uploaded successfully');
$this
->assertIdentical('en_US', \Drupal::state()
->get('lingotek.uploaded_locale'));
// There is a link for checking status.
$assert_session
->linkByHrefExists($basepath . '/admin/lingotek/config/check_upload/node_type/article?destination=' . $basepath . '/admin/lingotek/config/manage');
// And we can already request a translation.
$assert_session
->linkByHrefExists($basepath . '/admin/lingotek/config/request/node_type/article/es_MX?destination=' . $basepath . '/admin/lingotek/config/manage');
$assert_session
->linkByHrefNotExists($basepath . '/admin/lingotek/config/request/node_type/article/ca_ES?destination=' . $basepath . '/admin/lingotek/config/manage');
$this
->clickLink('EN');
$this
->assertText('Article status checked successfully');
$assert_session
->linkByHrefNotExists($basepath . '/admin/lingotek/config/request/node_type/article/ca_ES?destination=' . $basepath . '/admin/lingotek/config/manage');
$assert_session
->linkByHrefExists($basepath . '/admin/lingotek/config/request/node_type/article/es_MX?destination=' . $basepath . '/admin/lingotek/config/manage');
$this
->assertTargetStatus('es', Lingotek::STATUS_REQUEST);
$this
->assertTargetStatus('ca', Lingotek::STATUS_DISABLED);
}