Skip to content
Snippets Groups Projects
Commit 26b77f3e authored by Mingsong's avatar Mingsong Committed by Alastair Moore
Browse files

Issue #3444549 by Mingsong, welly: Auto test for this module

parent c67332b7
No related branches found
No related tags found
1 merge request!8Issue #3444549: First auto test for this module
Pipeline #174467 passed
......@@ -48,6 +48,7 @@ include:
################
variables:
SKIP_ESLINT: '1'
_CSPELL_IGNORE_PATHS: '"**/*.yml"'
###################################################################################
#
......
<?php
declare(strict_types=1);
namespace Drupal\Tests\quill\Functional;
use Drupal\Tests\BrowserTestBase;
/**
* Generic module test for Quill module.
*
* @group quill
*/
class GenericTest extends BrowserTestBase {
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';
/**
* Checks installation about this module.
*/
public function testModuleInstallation(): void {
$module_installer = \Drupal::service('module_installer');
// Check the installation of this module.
$this->assertTrue($module_installer->install(['quill']));
$info = \Drupal::service('extension.list.module')->getExtensionInfo('quill');
if (!empty($info['required']) && !empty($info['hidden'])) {
$this->markTestSkipped('Nothing to assert for hidden, required modules.');
}
if (empty($info['required'])) {
// Check that the module can be uninstalled and then re-installed again.
$this->assertTrue($module_installer->uninstall(['quill']), "Failed to uninstall Quill module");
$this->assertTrue($module_installer->install(['quill']), "Failed to install Quill module");
}
}
}
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