You are here

public function LingotekContentTypeBulkTranslationTest::testAddingLanguageAllowsRequesting in Lingotek Translation 8

Tests that a config can be translated using the links on the management page.

1 call to LingotekContentTypeBulkTranslationTest::testAddingLanguageAllowsRequesting()
LingotekContentTypeBulkTranslationTest::testFormWorksAfterRemovingLanguageWithStatuses in src/Tests/LingotekContentTypeBulkTranslationTest.php
Tests that a config can be translated using the links on the management page.

File

src/Tests/LingotekContentTypeBulkTranslationTest.php, line 369

Class

LingotekContentTypeBulkTranslationTest
Tests translating a config entity using the bulk management form.

Namespace

Drupal\lingotek\Tests

Code

public function testAddingLanguageAllowsRequesting() {

  // We need a node with translations first.
  $this
    ->testContentTypeTranslationUsingLinks();

  // Add a language.
  ConfigurableLanguage::createFromLangcode('ca')
    ->save();

  // Go to the bulk config management page.
  $this
    ->goToConfigBulkManagementForm('node_type');
  $basepath = \Drupal::request()
    ->getBasePath();

  // There is a link for requesting the Catalan translation.
  $this
    ->assertLinkByHref($basepath . '/admin/lingotek/config/request/node_type/article/ca_ES?destination=' . $basepath . '/admin/lingotek/config/manage');
  $this
    ->clickLink('CA');
  $this
    ->assertText("Translation to ca_ES requested successfully");
}