You are here

public function LanguageFormTest::testDisablingCustomLanguage 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::testDisablingCustomLanguage()
  2. 3.0.x tests/src/Functional/Form/LanguageFormTest.php \Drupal\Tests\lingotek\Functional\Form\LanguageFormTest::testDisablingCustomLanguage()
  3. 3.1.x tests/src/Functional/Form/LanguageFormTest.php \Drupal\Tests\lingotek\Functional\Form\LanguageFormTest::testDisablingCustomLanguage()
  4. 3.2.x tests/src/Functional/Form/LanguageFormTest.php \Drupal\Tests\lingotek\Functional\Form\LanguageFormTest::testDisablingCustomLanguage()
  5. 3.3.x tests/src/Functional/Form/LanguageFormTest.php \Drupal\Tests\lingotek\Functional\Form\LanguageFormTest::testDisablingCustomLanguage()
  6. 3.4.x tests/src/Functional/Form/LanguageFormTest.php \Drupal\Tests\lingotek\Functional\Form\LanguageFormTest::testDisablingCustomLanguage()
  7. 3.5.x tests/src/Functional/Form/LanguageFormTest.php \Drupal\Tests\lingotek\Functional\Form\LanguageFormTest::testDisablingCustomLanguage()
  8. 3.6.x tests/src/Functional/Form/LanguageFormTest.php \Drupal\Tests\lingotek\Functional\Form\LanguageFormTest::testDisablingCustomLanguage()
  9. 3.7.x tests/src/Functional/Form/LanguageFormTest.php \Drupal\Tests\lingotek\Functional\Form\LanguageFormTest::testDisablingCustomLanguage()
  10. 3.8.x tests/src/Functional/Form/LanguageFormTest.php \Drupal\Tests\lingotek\Functional\Form\LanguageFormTest::testDisablingCustomLanguage()

Tests disabling for Lingotek a custom language that was enabled.

File

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

Class

LanguageFormTest
Test the Drupal language form alters.

Namespace

Drupal\Tests\lingotek\Functional\Form

Code

public function testDisablingCustomLanguage() {
  $this
    ->testAddingCustomLanguage();

  // Check that there is a select for locales.
  $this
    ->drupalGet('/admin/config/regional/language');

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

  // The Lingotek locale is enabled by default.
  $this
    ->getSession()
    ->getPage()
    ->hasUncheckedField('lingotek_disabled');
  $edit = [
    'lingotek_disabled' => TRUE,
  ];
  $this
    ->drupalPostForm(NULL, $edit, 'Save language');

  // Ensure the language is disabled.
  $language = ConfigurableLanguage::load('es-DE');
  $this
    ->assertTrue($language
    ->getThirdPartySetting('lingotek', 'disabled'), 'The Lingotek locale has been disabled successfully.');

  // Check that there is a select for locales.
  $this
    ->drupalGet('/admin/config/regional/language');

  // Click on edit for Spanish (Germany).
  $this
    ->clickLink('Edit', 1);
  $this
    ->getSession()
    ->getPage()
    ->hasCheckedField('lingotek_disabled');
}