You are here

public function GNodeWebTestBase::createGroupType in Group 7

Create a GroupType entity.

Parameters

string $machine_name:

string $label: (optional) if omitted, the label is the same as the name.

Return value

\GroupType

26 calls to GNodeWebTestBase::createGroupType()
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.

... See full list

File

modules/gnode/tests/gnode.test, line 95
Tests for the gnode module.

Class

GNodeWebTestBase
Base class provides a number of helper functions.

Code

public function createGroupType($machine_name, $label = '') {
  $label = empty($label) ? $machine_name : $label;
  $group_type = new GroupType(array(
    'name' => $machine_name,
    'label' => $label,
    'anonymous_permissions' => array(),
    'outsider_permissions' => array(),
    'member_permissions' => array(),
    'config' => array(),
    'weight' => 0,
    'status' => 1,
    'module' => NULL,
  ), 'group_type');
  $group_type
    ->save();
  return $group_type;
}