You are here

protected function TestModuleContext::getModules in Lightning Core 8.2

Same name and namespace in other branches
  1. 8.5 tests/contexts/TestModuleContext.behat.inc \Acquia\LightningExtension\Context\TestModuleContext::getModules()
  2. 8 tests/contexts/TestModuleContext.behat.inc \Acquia\LightningExtension\Context\TestModuleContext::getModules()
  3. 8.3 tests/contexts/TestModuleContext.behat.inc \Acquia\LightningExtension\Context\TestModuleContext::getModules()
  4. 8.4 tests/contexts/TestModuleContext.behat.inc \Acquia\LightningExtension\Context\TestModuleContext::getModules()

Determines the test modules to install during the scenario.

Parameters

ScenarioScope $scope: The current scenario scope.

Return value

string[] The test modules to install.

2 calls to TestModuleContext::getModules()
TestModuleContext::install in tests/contexts/TestModuleContext.behat.inc
Installs test modules for this scenario.
TestModuleContext::uninstall in tests/contexts/TestModuleContext.behat.inc
Uninstalls any test modules installed for the scenario.

File

tests/contexts/TestModuleContext.behat.inc, line 30

Class

TestModuleContext
Allows test modules to be installed during a scenario and uninstalled after.

Namespace

Acquia\LightningExtension\Context

Code

protected function getModules(ScenarioScope $scope) {
  $modules = [];
  $tags = array_merge($scope
    ->getFeature()
    ->getTags(), $scope
    ->getScenario()
    ->getTags());
  foreach ($tags as $tag) {
    if (strpos($tag, 'with-module:') === 0) {
      $modules[] = substr($tag, 12);
    }
  }
  return array_unique($modules);
}