public function LanguageFormTest::testEditingCustomLanguageWithUnderscoredLocale in Lingotek Translation 4.0.x
Same name and namespace in other branches
- 8.2 tests/src/Functional/Form/LanguageFormTest.php \Drupal\Tests\lingotek\Functional\Form\LanguageFormTest::testEditingCustomLanguageWithUnderscoredLocale()
- 3.0.x tests/src/Functional/Form/LanguageFormTest.php \Drupal\Tests\lingotek\Functional\Form\LanguageFormTest::testEditingCustomLanguageWithUnderscoredLocale()
- 3.1.x tests/src/Functional/Form/LanguageFormTest.php \Drupal\Tests\lingotek\Functional\Form\LanguageFormTest::testEditingCustomLanguageWithUnderscoredLocale()
- 3.2.x tests/src/Functional/Form/LanguageFormTest.php \Drupal\Tests\lingotek\Functional\Form\LanguageFormTest::testEditingCustomLanguageWithUnderscoredLocale()
- 3.3.x tests/src/Functional/Form/LanguageFormTest.php \Drupal\Tests\lingotek\Functional\Form\LanguageFormTest::testEditingCustomLanguageWithUnderscoredLocale()
- 3.4.x tests/src/Functional/Form/LanguageFormTest.php \Drupal\Tests\lingotek\Functional\Form\LanguageFormTest::testEditingCustomLanguageWithUnderscoredLocale()
- 3.5.x tests/src/Functional/Form/LanguageFormTest.php \Drupal\Tests\lingotek\Functional\Form\LanguageFormTest::testEditingCustomLanguageWithUnderscoredLocale()
- 3.6.x tests/src/Functional/Form/LanguageFormTest.php \Drupal\Tests\lingotek\Functional\Form\LanguageFormTest::testEditingCustomLanguageWithUnderscoredLocale()
- 3.7.x tests/src/Functional/Form/LanguageFormTest.php \Drupal\Tests\lingotek\Functional\Form\LanguageFormTest::testEditingCustomLanguageWithUnderscoredLocale()
- 3.8.x tests/src/Functional/Form/LanguageFormTest.php \Drupal\Tests\lingotek\Functional\Form\LanguageFormTest::testEditingCustomLanguageWithUnderscoredLocale()
Tests editing a custom language with a custom locale.
File
- tests/
src/ Functional/ Form/ LanguageFormTest.php, line 237
Class
- LanguageFormTest
- Test the Drupal language form alters.
Namespace
Drupal\Tests\lingotek\Functional\FormCode
public function testEditingCustomLanguageWithUnderscoredLocale() {
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_AT',
];
$this
->drupalPostForm(NULL, $edit, 'Save 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.');
}