public function LanguageFormTest::testEditingLanguageWith401 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::testEditingLanguageWith401()
- 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.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 78
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.");
}