You are here

public function FeatureContext::iSelectGroup in Open Social 8.9

Same name and namespace in other branches
  1. 8.3 tests/behat/features/bootstrap/FeatureContext.php \Drupal\social\Behat\FeatureContext::iSelectGroup()
  2. 8.4 tests/behat/features/bootstrap/FeatureContext.php \Drupal\social\Behat\FeatureContext::iSelectGroup()
  3. 8.5 tests/behat/features/bootstrap/FeatureContext.php \Drupal\social\Behat\FeatureContext::iSelectGroup()
  4. 8.6 tests/behat/features/bootstrap/FeatureContext.php \Drupal\social\Behat\FeatureContext::iSelectGroup()
  5. 8.7 tests/behat/features/bootstrap/FeatureContext.php \Drupal\social\Behat\FeatureContext::iSelectGroup()
  6. 8.8 tests/behat/features/bootstrap/FeatureContext.php \Drupal\social\Behat\FeatureContext::iSelectGroup()
  7. 10.3.x tests/behat/features/bootstrap/FeatureContext.php \Drupal\social\Behat\FeatureContext::iSelectGroup()
  8. 10.0.x tests/behat/features/bootstrap/FeatureContext.php \Drupal\social\Behat\FeatureContext::iSelectGroup()
  9. 10.1.x tests/behat/features/bootstrap/FeatureContext.php \Drupal\social\Behat\FeatureContext::iSelectGroup()
  10. 10.2.x tests/behat/features/bootstrap/FeatureContext.php \Drupal\social\Behat\FeatureContext::iSelectGroup()

@When I select group :group

File

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

Class

FeatureContext
Defines application features from the specific context.

Namespace

Drupal\social\Behat

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);
}