public function TestModuleContext::install in Lightning Core 8.3
Same name and namespace in other branches
- 8.5 tests/contexts/TestModuleContext.behat.inc \Acquia\LightningExtension\Context\TestModuleContext::install()
- 8 tests/contexts/TestModuleContext.behat.inc \Acquia\LightningExtension\Context\TestModuleContext::install()
- 8.2 tests/contexts/TestModuleContext.behat.inc \Acquia\LightningExtension\Context\TestModuleContext::install()
- 8.4 tests/contexts/TestModuleContext.behat.inc \Acquia\LightningExtension\Context\TestModuleContext::install()
Installs test modules for this scenario.
@BeforeScenario
Parameters
Behat\Behat\Hook\Scope\BeforeScenarioScope $scope: The scenario scope.
File
- tests/
contexts/ TestModuleContext.behat.inc, line 54
Class
- TestModuleContext
- Allows test modules to be installed during a scenario and uninstalled after.
Namespace
Acquia\LightningExtension\ContextCode
public function install(BeforeScenarioScope $scope) {
$modules = $this
->getModules($scope);
if ($modules) {
// Bootstrap Drupal if needed.
$driver = $this
->getDriver();
if (!$driver
->isBootstrapped()) {
$driver
->bootstrap();
}
// Ensure that test directories are scanned for modules.
$settings = Settings::getAll();
$settings['extension_discovery_scan_tests'] = TRUE;
new Settings($settings);
\Drupal::service('module_installer')
->install($modules);
}
}