You are here

public function LingotekModuleInstallationTest::testEnableModule in Lingotek Translation 8

Tests that the module can be enabled.

File

src/Tests/LingotekModuleInstallationTest.php, line 22
Contains \Drupal\lingotek\Tests\LingotekModuleInstallationTest.

Class

LingotekModuleInstallationTest
Tests that the module can be enabled.

Namespace

Drupal\lingotek\Tests

Code

public function testEnableModule() {

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

  // Navigate to the Extend page.
  $this
    ->drupalGet('/admin/modules');

  // Ensure the module is not enabled yet.
  $this
    ->assertNoFieldChecked('edit-modules-multilingual-lingotek-enable');

  // Post the form enabling the lingotek module.
  $edit = [
    'modules[Multilingual][lingotek][enable]' => '1',
  ];
  $this
    ->drupalPostForm(NULL, $edit, 'Install');

  // Dependencies installation is requested.
  $this
    ->assertText('Some required modules must be enabled');
  $this
    ->drupalPostForm(NULL, [], 'Continue');

  // The module is enabled successfully with its dependencies.
  $this
    ->assertText('modules have been enabled: Lingotek Translation');
}