public newGroup ( integer | string $groupId, Storyplayer\TestEnvironments\GroupAdapter $groupAdapter ) : TestEnvironmentGroup | ||
$groupId | integer | string | the ID of this group |
$groupAdapter | Storyplayer\TestEnvironments\GroupAdapter | the adapter for this group |
return | TestEnvironmentGroup | a new and empty group, ready for you to define |
public function newGroup($groupId, GroupAdapter $groupAdapter)
{
// make sure that we don't already have a group with this ID
if (isset($this->groups[$groupId])) {
throw new E4xx_DuplicateGroupId($groupId);
}
// if we get here, we're good
$this->groups[$groupId] = new TestEnvironment_GroupDefinition($this, $groupId, $groupAdapter);
return end($this->groups);
}