public function LanguageFormTest::testEditingLanguageWith401 in Lingotek Translation 8.2
Same name and namespace in other branches
- 4.0.x tests/src/Functional/Form/LanguageFormTest.php \Drupal\Tests\lingotek\Functional\Form\LanguageFormTest::testEditingLanguageWith401()
- 3.0.x tests/src/Functional/Form/LanguageFormTest.php \Drupal\Tests\lingotek\Functional\Form\LanguageFormTest::testEditingLanguageWith401()
- 3.1.x tests/src/Functional/Form/LanguageFormTest.php \Drupal\Tests\lingotek\Functional\Form\LanguageFormTest::testEditingLanguageWith401()
- 3.2.x tests/src/Functional/Form/LanguageFormTest.php \Drupal\Tests\lingotek\Functional\Form\LanguageFormTest::testEditingLanguageWith401()
- 3.3.x tests/src/Functional/Form/LanguageFormTest.php \Drupal\Tests\lingotek\Functional\Form\LanguageFormTest::testEditingLanguageWith401()
- 3.4.x tests/src/Functional/Form/LanguageFormTest.php \Drupal\Tests\lingotek\Functional\Form\LanguageFormTest::testEditingLanguageWith401()
- 3.5.x tests/src/Functional/Form/LanguageFormTest.php \Drupal\Tests\lingotek\Functional\Form\LanguageFormTest::testEditingLanguageWith401()
- 3.6.x tests/src/Functional/Form/LanguageFormTest.php \Drupal\Tests\lingotek\Functional\Form\LanguageFormTest::testEditingLanguageWith401()
- 3.7.x tests/src/Functional/Form/LanguageFormTest.php \Drupal\Tests\lingotek\Functional\Form\LanguageFormTest::testEditingLanguageWith401()
- 3.8.x tests/src/Functional/Form/LanguageFormTest.php \Drupal\Tests\lingotek\Functional\Form\LanguageFormTest::testEditingLanguageWith401()
Tests editing a defined language has the right locale.
File
- tests/
src/ Functional/ Form/ LanguageFormTest.php, line 79
Class
- LanguageFormTest
- Test the Drupal language form alters.
Namespace
Drupal\Tests\lingotek\Functional\FormCode
public function testEditingLanguageWith401() {
// This is a hack for avoiding writing different lingotek endpoint mocks.
\Drupal::state()
->set('lingotek.locales_error', TRUE);
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)');
$this
->assertText("The Lingotek locale has not been validated.");
}