You are here

public function FeatureContext::iSelectGroup in Open Social 8.2

Same name and namespace in other branches
  1. 8 tests/behat/features/bootstrap/FeatureContext.php \FeatureContext::iSelectGroup()

@When I select group :group

File

tests/behat/features/bootstrap/FeatureContext.php, line 236

Class

FeatureContext
Defines application features from the specific context.

Code

public function iSelectGroup($group) {
  if ($group === "- None -") {
    $option = '_none';
  }
  if ($group !== "- None -") {
    $option = $this
      ->getGroupIdFromTitle($group);
  }
  if (!$option) {
    throw new \InvalidArgumentException(sprintf('Could not find group for "%s"', $group));
  }
  $this
    ->getSession()
    ->getPage()
    ->selectFieldOption('edit-groups', $option);
}