Skip to content
Snippets Groups Projects
Commit 2c14669f authored by mindaugasd's avatar mindaugasd
Browse files

Issue #3426301: Add basic tests (and setup GitLab CI)

parent 915c2f82
No related branches found
No related tags found
No related merge requests found
Pipeline #139107 passed with warnings
<?php
namespace Drupal\Tests\aichat_backend_example\Functional;
use Drupal\Tests\BrowserTestBase;
/**
* Tests the installation and uninstallation processes of the aichat_backend_example submodule.
*/
class AichatBackendExampleLifecycleTest extends BrowserTestBase {
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';
/**
* Modules to enable.
*
* @var array
*/
public static $modules = ['aichat', 'aichat_backend_example'];
/**
* Tests aichat_backend_example module installation.
*/
public function testModuleInstallation() {
$this->assertTrue(\Drupal::moduleHandler()->moduleExists('aichat_backend_example'), 'The aichat_backend_example module is installed.');
}
/**
* Tests aichat_backend_example module uninstallation.
*/
public function testModuleUninstallation() {
\Drupal::service('module_installer')->uninstall(['aichat_backend_example']);
$this->assertFalse(\Drupal::moduleHandler()->moduleExists('aichat_backend_example'), 'The aichat_backend_example module is uninstalled.');
}
}
<?php
namespace Drupal\Tests\aichat\Functional;
use Drupal\Tests\BrowserTestBase;
/**
* Tests the installation and uninstallation processes of the aichat module.
*/
class AichatModuleLifecycleTest extends BrowserTestBase {
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';
/**
* Modules to enable.
*
* @var array
*/
public static $modules = ['aichat'];
/**
* Tests aichat module installation.
*/
public function testModuleInstallation() {
$this->assertTrue(\Drupal::moduleHandler()->moduleExists('aichat'), 'The aichat module is installed.');
}
/**
* Tests aichat module uninstallation.
*/
public function testModuleUninstallation() {
\Drupal::service('module_installer')->uninstall(['aichat']);
$this->assertFalse(\Drupal::moduleHandler()->moduleExists('aichat'), 'The aichat module is uninstalled.');
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment