You are here

public function ManageDisplayTest::testNestField in Field Group 8.3

Same name and namespace in other branches
  1. 8 tests/src/Functional/ManageDisplayTest.php \Drupal\Tests\field_group\Functional\ManageDisplayTest::testNestField()

Nest a field underneath a group.

File

tests/src/Functional/ManageDisplayTest.php, line 151

Class

ManageDisplayTest
Tests for managing display of entities.

Namespace

Drupal\Tests\field_group\Functional

Code

public function testNestField() {
  $data = [
    'format_type' => 'fieldset',
  ];
  $group = $this
    ->createGroup('node', $this->type, 'form', 'default', $data);
  $edit = [
    'fields[body][parent]' => $group->group_name,
  ];
  $this
    ->drupalGet('admin/structure/types/manage/' . $this->type . '/form-display');
  $this
    ->submitForm($edit, 'Save');
  $this
    ->assertSession()
    ->responseContains('Your settings have been saved.');
  $group = field_group_load_field_group($group->group_name, 'node', $this->type, 'form', 'default');
  $this
    ->assertTrue(in_array('body', $group->children), t('Body is a child of %group', [
    '%group' => $group->group_name,
  ]));
}