You are here

public function FeatureContext::createGroups in Open Social 8

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

Creates group of a given type provided in the form: | title | description | author | type | language | My title | My description | username | open_group | en | ... | ... | ... | ... | ...

@Given groups:

File

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

Class

FeatureContext
Defines application features from the specific context.

Code

public function createGroups(TableNode $groupsTable) {
  foreach ($groupsTable
    ->getHash() as $groupHash) {
    $groupFields = (object) $groupHash;
    try {
      $group = $this
        ->groupCreate($groupFields);
      $this->groups[$groupFields->title] = $group;
    } catch (Exception $e) {
    }
  }
}