You are here

function GroupDisplayTestCase::createGroup in Field Group 7

Create a new group.

Parameters

array $data: Data for the field group.

5 calls to GroupDisplayTestCase::createGroup()
GroupDisplayTestCase::testAccordion in tests/field_group.display.test
Test the accordion formatter.
GroupDisplayTestCase::testDiv in tests/field_group.display.test
Test the div formatter.
GroupDisplayTestCase::testFieldAccess in tests/field_group.display.test
Test if an empty formatter.
GroupDisplayTestCase::testHorizontalTabs in tests/field_group.display.test
Test the horizontal tabs formatter.
GroupDisplayTestCase::testVerticalTabs in tests/field_group.display.test
Test the vertical tabs formatter.

File

tests/field_group.display.test, line 76
Test file for fieldgroup display.

Class

GroupDisplayTestCase
Group display tests

Code

function createGroup($mode, array $data) {
  $group_name = 'group_' . drupal_strtolower($this
    ->randomName(8));
  $identifier = $group_name . '|node|article|' . $mode;
  $field_group = new stdClass();
  $field_group->disabled = FALSE;
  $field_group->api_version = 1;
  $field_group->identifier = $identifier;
  $field_group->group_name = $group_name;
  $field_group->entity_type = 'node';
  $field_group->bundle = 'article';
  $field_group->mode = $mode;
  $field_group->parent_name = '';
  $field_group->children = $data['children'];
  $field_group->data = $data;
  drupal_write_record('field_group', $field_group);
  ctools_export_crud_enable('field_group', $field_group->identifier);
  return $field_group;
}