You are here

public function LanguageFormTest::testEditingCustomLanguage in Lingotek Translation 4.0.x

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

Tests editing a custom language with a custom locale.

File

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

Class

LanguageFormTest
Test the Drupal language form alters.

Namespace

Drupal\Tests\lingotek\Functional\Form

Code

public function testEditingCustomLanguage() {
  ConfigurableLanguage::create([
    'id' => 'de-at',
    'label' => 'German (AT)',
  ])
    ->save();
  $this
    ->drupalGet('/admin/config/regional/language');

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

  // Assert that the locale is correct.
  $this
    ->assertFieldByName('lingotek_locale', 'de-AT', 'The Lingotek locale is set to the right language.');

  // Edit the locale.
  $edit = [
    'lingotek_locale' => 'de-DE',
  ];
  $this
    ->drupalPostForm(NULL, $edit, 'Save language');

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

  // Assert that the locale is correct.
  $this
    ->assertFieldByName('lingotek_locale', 'de-DE', 'The Lingotek locale is set to the right language after editing.');
}