You are here

public function LingotekInterfaceTranslationTest::testAddingLanguageAllowsRequesting in Lingotek Translation 3.6.x

Same name and namespace in other branches
  1. 4.0.x tests/src/Functional/LingotekInterfaceTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekInterfaceTranslationTest::testAddingLanguageAllowsRequesting()
  2. 3.2.x tests/src/Functional/LingotekInterfaceTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekInterfaceTranslationTest::testAddingLanguageAllowsRequesting()
  3. 3.3.x tests/src/Functional/LingotekInterfaceTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekInterfaceTranslationTest::testAddingLanguageAllowsRequesting()
  4. 3.4.x tests/src/Functional/LingotekInterfaceTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekInterfaceTranslationTest::testAddingLanguageAllowsRequesting()
  5. 3.5.x tests/src/Functional/LingotekInterfaceTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekInterfaceTranslationTest::testAddingLanguageAllowsRequesting()
  6. 3.7.x tests/src/Functional/LingotekInterfaceTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekInterfaceTranslationTest::testAddingLanguageAllowsRequesting()
  7. 3.8.x tests/src/Functional/LingotekInterfaceTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekInterfaceTranslationTest::testAddingLanguageAllowsRequesting()

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

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

File

tests/src/Functional/LingotekInterfaceTranslationTest.php, line 271

Class

LingotekInterfaceTranslationTest
Tests translating the user interface using the Lingotek form.

Namespace

Drupal\Tests\lingotek\Functional

Code

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

  // We need translations first.
  $this
    ->testInterfaceTranslationUsingLinks();

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

  // There is a link for requesting the Catalan translation.
  // In Drupal.org CI the module will be at modules/contrib/lingotek.
  // In my local that's modules/lingotek. We need to generate the path and not
  // hardcode it.
  $path = drupal_get_path('module', 'lingotek_interface_translation_test');
  $component = $path;
  $this
    ->assertLingotekInterfaceTranslationRequestTranslationLink($component, 'ca_ES');
  $this
    ->clickLink('CA');
  $assert_session
    ->responseContains('Locale \'ca_ES\' was added as a translation target for <em class="placeholder">' . $component . '</em>.');
}