You are here

public function LingotekInterfaceTranslationTest::testInterfaceTranslationWithoutPotx in Lingotek Translation 3.3.x

Same name and namespace in other branches
  1. 4.0.x tests/src/Functional/LingotekInterfaceTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekInterfaceTranslationTest::testInterfaceTranslationWithoutPotx()
  2. 3.2.x tests/src/Functional/LingotekInterfaceTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekInterfaceTranslationTest::testInterfaceTranslationWithoutPotx()
  3. 3.4.x tests/src/Functional/LingotekInterfaceTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekInterfaceTranslationTest::testInterfaceTranslationWithoutPotx()
  4. 3.5.x tests/src/Functional/LingotekInterfaceTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekInterfaceTranslationTest::testInterfaceTranslationWithoutPotx()
  5. 3.6.x tests/src/Functional/LingotekInterfaceTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekInterfaceTranslationTest::testInterfaceTranslationWithoutPotx()
  6. 3.7.x tests/src/Functional/LingotekInterfaceTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekInterfaceTranslationTest::testInterfaceTranslationWithoutPotx()
  7. 3.8.x tests/src/Functional/LingotekInterfaceTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekInterfaceTranslationTest::testInterfaceTranslationWithoutPotx()

Tests when potx is not present.

File

tests/src/Functional/LingotekInterfaceTranslationTest.php, line 44

Class

LingotekInterfaceTranslationTest
Tests translating the user interface using the Lingotek form.

Namespace

Drupal\Tests\lingotek\Functional

Code

public function testInterfaceTranslationWithoutPotx() {
  $assert_session = $this
    ->assertSession();

  // Login as admin.
  $this
    ->drupalLogin($this->rootUser);
  $this
    ->drupalGet('/admin/modules');

  // Ensure the module is not enabled yet.
  $this
    ->assertSession()
    ->checkboxChecked('edit-modules-potx-enable');
  $this
    ->clickLink('Uninstall');

  // Post the form uninstalling the lingotek module.
  $edit = [
    'uninstall[potx]' => '1',
  ];
  $this
    ->drupalPostForm(NULL, $edit, 'Uninstall');

  // We get an advice and we can confirm.
  $assert_session
    ->responseContains('The following modules will be completely uninstalled from your site, and <em>all data from these modules will be lost</em>!');
  $assert_session
    ->responseContains('Translation template extractor');
  $this
    ->drupalPostForm(NULL, [], 'Uninstall');
  $this
    ->goToInterfaceTranslationManagementForm();
  $assert_session
    ->responseContains('The <a href="https://www.drupal.org/project/potx">potx</a> module is required for interface translation with Lingotek');
}