1 field_group.ui.test public GroupUITestCase::testNestField()

Nest a field underneath a group.

File

core/modules/field_group/tests/field_group.ui.test, line 91
Test file for Field Group UI.

Class

GroupUITestCase
Test the Field Group UI.

Code

public function testNestField() {

  $this->createGroup();

  $edit = array(
    'fields[field_image][parent]' => $this->group_name,
  );
  $this->backdropPost('admin/structure/types/manage/post/fields', $edit, t('Save'));
  $this->assertRaw(t('Your settings have been saved.'), t('Settings saved'));

  $groups = field_group_info_groups('node', 'post', '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)));
}