You are here

public function LingotekSystemSiteBulkTranslationTest::testAddingLanguageAllowsRequesting in Lingotek Translation 8

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

File

src/Tests/LingotekSystemSiteBulkTranslationTest.php, line 267

Class

LingotekSystemSiteBulkTranslationTest
Tests translating a config object using the bulk management form.

Namespace

Drupal\lingotek\Tests

Code

public function testAddingLanguageAllowsRequesting() {

  // We need a config object with translations first.
  $this
    ->testSystemSiteTranslationUsingLinks();

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

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

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