LingotekModuleInstallationTest.php in Lingotek Translation 3.7.x
Same filename and directory in other branches
- 8.2 tests/src/Functional/LingotekModuleInstallationTest.php
- 4.0.x tests/src/Functional/LingotekModuleInstallationTest.php
- 3.0.x tests/src/Functional/LingotekModuleInstallationTest.php
- 3.1.x tests/src/Functional/LingotekModuleInstallationTest.php
- 3.2.x tests/src/Functional/LingotekModuleInstallationTest.php
- 3.3.x tests/src/Functional/LingotekModuleInstallationTest.php
- 3.4.x tests/src/Functional/LingotekModuleInstallationTest.php
- 3.5.x tests/src/Functional/LingotekModuleInstallationTest.php
- 3.6.x tests/src/Functional/LingotekModuleInstallationTest.php
- 3.8.x tests/src/Functional/LingotekModuleInstallationTest.php
Namespace
Drupal\Tests\lingotek\FunctionalFile
tests/src/Functional/LingotekModuleInstallationTest.phpView source
<?php
namespace Drupal\Tests\lingotek\Functional;
use Drupal\Tests\BrowserTestBase;
/**
* Tests that the module can be enabled.
*
* @group lingotek
*/
class LingotekModuleInstallationTest extends BrowserTestBase {
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';
/**
* Tests that the module can be enabled.
*/
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-lingotek-enable');
// Post the form enabling the lingotek module.
$edit = [
'modules[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');
}
/**
* Tests that the weight of the module is higher than content_translation.
*/
public function testModuleWeightAgainstContentTranslation() {
$this
->testEnableModule();
$extension_config = $this
->config('core.extension');
$content_translation_weight = $extension_config
->get('module.content_translation');
$lingotek_weight = $extension_config
->get('module.lingotek');
$this
->assertTrue($lingotek_weight > $content_translation_weight, 'Lingotek weight is higher than content_translation.');
}
}
Classes
Name | Description |
---|---|
LingotekModuleInstallationTest | Tests that the module can be enabled. |