You are here

public function LingotekFieldBodyBulkTranslationTest::testAddingLanguageAllowsRequesting in Lingotek Translation 3.7.x

Same name and namespace in other branches
  1. 8.2 tests/src/Functional/LingotekFieldBodyBulkTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekFieldBodyBulkTranslationTest::testAddingLanguageAllowsRequesting()
  2. 4.0.x tests/src/Functional/LingotekFieldBodyBulkTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekFieldBodyBulkTranslationTest::testAddingLanguageAllowsRequesting()
  3. 3.0.x tests/src/Functional/LingotekFieldBodyBulkTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekFieldBodyBulkTranslationTest::testAddingLanguageAllowsRequesting()
  4. 3.1.x tests/src/Functional/LingotekFieldBodyBulkTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekFieldBodyBulkTranslationTest::testAddingLanguageAllowsRequesting()
  5. 3.2.x tests/src/Functional/LingotekFieldBodyBulkTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekFieldBodyBulkTranslationTest::testAddingLanguageAllowsRequesting()
  6. 3.3.x tests/src/Functional/LingotekFieldBodyBulkTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekFieldBodyBulkTranslationTest::testAddingLanguageAllowsRequesting()
  7. 3.4.x tests/src/Functional/LingotekFieldBodyBulkTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekFieldBodyBulkTranslationTest::testAddingLanguageAllowsRequesting()
  8. 3.5.x tests/src/Functional/LingotekFieldBodyBulkTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekFieldBodyBulkTranslationTest::testAddingLanguageAllowsRequesting()
  9. 3.6.x tests/src/Functional/LingotekFieldBodyBulkTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekFieldBodyBulkTranslationTest::testAddingLanguageAllowsRequesting()
  10. 3.8.x tests/src/Functional/LingotekFieldBodyBulkTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekFieldBodyBulkTranslationTest::testAddingLanguageAllowsRequesting()

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

File

tests/src/Functional/LingotekFieldBodyBulkTranslationTest.php, line 337

Class

LingotekFieldBodyBulkTranslationTest
Tests translating a field using the bulk management form.

Namespace

Drupal\Tests\lingotek\Functional

Code

public function testAddingLanguageAllowsRequesting() {
  $assert_session = $this
    ->assertSession();

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

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

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

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