You are here

public static function AuditLogFeatureContext::prepare in Audit Log 8.2

Setup for the test suite, enable some required modules and add content title.

@BeforeSuite

File

tests/src/Behat/features/bootstrap/AuditLogFeatureContext.php, line 20

Class

AuditLogFeatureContext
Behat steps for testing the audit_log module.

Code

public static function prepare(BeforeSuiteScope $scope) {

  /** @var \Drupal\Core\Extension\ModuleHandler $moduleHandler */
  $moduleHandler = \Drupal::service('module_handler');
  if (!$moduleHandler
    ->moduleExists('audit_log')) {
    \Drupal::service('module_installer')
      ->install([
      'audit_log',
    ]);
  }

  // Also uninstall the inline form errors module for easier testing.
  if ($moduleHandler
    ->moduleExists('inline_form_errors')) {
    \Drupal::service('module_installer')
      ->uninstall([
      'inline_form_errors',
    ]);
  }
}