You are here

public function LanguageFormTest::testEditingLanguage in Lingotek Translation 3.2.x

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

Tests editing a defined language has the right locale.

File

tests/src/Functional/Form/LanguageFormTest.php, line 63

Class

LanguageFormTest
Test the Drupal language form alters.

Namespace

Drupal\Tests\lingotek\Functional\Form

Code

public function testEditingLanguage() {
  ConfigurableLanguage::createFromLangcode('de')
    ->save();
  $this
    ->drupalGet('/admin/config/regional/language');

  // Click on edit for German.
  $this
    ->clickLink('Edit', 1);

  // Assert that the locale is correct.
  $this
    ->assertFieldByName('lingotek_locale', 'de-DE', 'The Lingotek locale is set correctly.');
  $this
    ->drupalPostForm(NULL, [
    'name' => 'German (Germany)',
  ], 'Save language');
  $this
    ->assertText('German (Germany)');
}