ElasticsearchConnectorFeatureContext.php in Elasticsearch Connector 8.5
File
tests/src/Behat/features/bootstrap/ElasticsearchConnectorFeatureContext.php
View source
<?php
use Behat\Behat\Context\SnippetAcceptingContext;
use Behat\Testwork\Hook\Scope\BeforeSuiteScope;
use Drupal\DrupalExtension\Context\RawDrupalContext;
class ElasticsearchConnectorFeatureContext extends RawDrupalContext implements SnippetAcceptingContext {
public static function prepare(BeforeSuiteScope $scope) {
$moduleHandler = \Drupal::service('module_handler');
if (!$moduleHandler
->moduleExists('elasticsearch_connector')) {
\Drupal::service('module_installer')
->install([
'elasticsearch_connector',
]);
}
if ($moduleHandler
->moduleExists('inline_form_errors')) {
\Drupal::service('module_installer')
->uninstall([
'inline_form_errors',
]);
}
}
}