You are here

function GroupUITestCase::testNestField in Field Group 7

Same name and namespace in other branches
  1. 7.2 field_group.test \GroupUITestCase::testNestField()

Nest a field underneath a group.

File

tests/field_group.ui.test, line 94
Test file for fieldgroup UI.

Class

GroupUITestCase
Group UI tests.

Code

function testNestField() {
  $this
    ->createGroup();
  $edit = array(
    'fields[field_image][parent]' => $this->group_name,
  );
  $this
    ->drupalPost('admin/structure/types/manage/article/fields', $edit, t('Save'));
  $this
    ->assertRaw(t('Your settings have been saved.'), t('Settings saved'));
  $groups = field_group_info_groups('node', 'article', 'form', TRUE);
  $this
    ->assertTrue(in_array('field_image', $groups[$this->group_name]->children), t('Image is a child of %group', array(
    '%group' => $this->group_name,
  )));
}