public function GNodeWebTestBase::createGroup in Group 7
Create a group.
Parameters
string $machine_name:
string $bundle_name:
string $title: (optional) If omitted, this is the same as the machine_name.
Return value
26 calls to GNodeWebTestBase::createGroup()
- GNodeBypassAccessTests::testAnonymousBypassGroupAccess in modules/
gnode/ tests/ gnode.test - Test anonymous user's access to nodes in a group when granted bypass group access.
- GNodeBypassAccessTests::testMemberBypassGroupAccess in modules/
gnode/ tests/ gnode.test - Test member user's access to nodes in a group when granted bypass group access.
- GNodeBypassAccessTests::testOutsiderBypassGroupAccess in modules/
gnode/ tests/ gnode.test - Test outsider user's access to nodes in a group when granted bypass group access.
- GNodeCreateAccessTests::testAnonymousCreateAccess in modules/
gnode/ tests/ gnode.test - Test anonymous user's create access to nodes in a group. This checks via several permissions: create node and administer group.
- GNodeCreateAccessTests::testMemberCreateAccess in modules/
gnode/ tests/ gnode.test - Test member user's create access to nodes in a group. This checks via several permissions: create node and administer group.
File
- modules/
gnode/ tests/ gnode.test, line 125 - Tests for the gnode module.
Class
- GNodeWebTestBase
- Base class provides a number of helper functions.
Code
public function createGroup($machine_name, $bundle_name, $title = '') {
$title = empty($title) ? $machine_name : $title;
$group = new Group(array(
'name' => $machine_name,
'title' => $title,
'type' => $bundle_name,
), 'group');
$group
->save();
return $group;
}