public function EntityDisplayTest::testFieldset in Field Group 8.3
Same name and namespace in other branches
- 8 tests/src/Functional/EntityDisplayTest.php \Drupal\Tests\field_group\Functional\EntityDisplayTest::testFieldset()
Test the fieldset formatter.
File
- tests/
src/ Functional/ EntityDisplayTest.php, line 188
Class
- EntityDisplayTest
- Tests for displaying entities.
Namespace
Drupal\Tests\field_group\FunctionalCode
public function testFieldset() {
$data = [
'weight' => '1',
'children' => [
0 => 'field_test',
1 => 'body',
],
'label' => 'Test Fieldset',
'format_type' => 'fieldset',
'format_settings' => [
'id' => 'fieldset-id',
'classes' => 'test-class',
'description' => 'test description',
],
];
$this
->createGroup('node', $this->type, 'view', 'default', $data);
$this
->drupalGet('node/' . $this->node
->id());
// Test group ids and classes.
$this
->assertCount(1, $this
->xpath("//fieldset[contains(@id, 'fieldset-id')]"), 'Correct id set on the fieldset');
$this
->assertCount(1, $this
->xpath("//fieldset[contains(@class, 'test-class')]"), 'Test class set on the fieldset');
}