You are here

public function ConfigTranslationListUiTest::doLanguageListTest in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/config_translation/tests/src/Functional/ConfigTranslationListUiTest.php \Drupal\Tests\config_translation\Functional\ConfigTranslationListUiTest::doLanguageListTest()
  2. 9 core/modules/config_translation/tests/src/Functional/ConfigTranslationListUiTest.php \Drupal\Tests\config_translation\Functional\ConfigTranslationListUiTest::doLanguageListTest()

Tests the language listing for the translate operation.

File

core/modules/config_translation/tests/src/Functional/ConfigTranslationListUiTest.php, line 333

Class

ConfigTranslationListUiTest
Visit all lists.

Namespace

Drupal\Tests\config_translation\Functional

Code

public function doLanguageListTest() {

  // Create a test language to decouple looking for translate operations
  // link so this does not test more than necessary.
  ConfigurableLanguage::createFromLangcode('ga')
    ->save();

  // Get the language listing.
  $this
    ->drupalGet('admin/config/regional/language');
  $translate_link = 'admin/config/regional/language/edit/ga/translate';

  // Test if the link to translate the language is on the page.
  $this
    ->assertSession()
    ->linkByHrefExists($translate_link);

  // Test if the link to translate actually goes to the translate page.
  $this
    ->drupalGet($translate_link);
  $this
    ->assertSession()
    ->responseContains('<th>Language</th>');
}