public function LanguageFormTest::testEditingCustomLanguage in Lingotek Translation 3.3.x
Same name and namespace in other branches
- 8.2 tests/src/Functional/Form/LanguageFormTest.php \Drupal\Tests\lingotek\Functional\Form\LanguageFormTest::testEditingCustomLanguage()
- 4.0.x tests/src/Functional/Form/LanguageFormTest.php \Drupal\Tests\lingotek\Functional\Form\LanguageFormTest::testEditingCustomLanguage()
- 3.0.x tests/src/Functional/Form/LanguageFormTest.php \Drupal\Tests\lingotek\Functional\Form\LanguageFormTest::testEditingCustomLanguage()
- 3.1.x tests/src/Functional/Form/LanguageFormTest.php \Drupal\Tests\lingotek\Functional\Form\LanguageFormTest::testEditingCustomLanguage()
- 3.2.x tests/src/Functional/Form/LanguageFormTest.php \Drupal\Tests\lingotek\Functional\Form\LanguageFormTest::testEditingCustomLanguage()
- 3.4.x tests/src/Functional/Form/LanguageFormTest.php \Drupal\Tests\lingotek\Functional\Form\LanguageFormTest::testEditingCustomLanguage()
- 3.5.x tests/src/Functional/Form/LanguageFormTest.php \Drupal\Tests\lingotek\Functional\Form\LanguageFormTest::testEditingCustomLanguage()
- 3.6.x tests/src/Functional/Form/LanguageFormTest.php \Drupal\Tests\lingotek\Functional\Form\LanguageFormTest::testEditingCustomLanguage()
- 3.7.x tests/src/Functional/Form/LanguageFormTest.php \Drupal\Tests\lingotek\Functional\Form\LanguageFormTest::testEditingCustomLanguage()
- 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\FormCode
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.');
}