'id' => 'foobar',
'label' => 'Foobar',
'description' => '',
'target_entity_type_id' => 'entity_test',
]);
$bundle->
save();
// Add a new comment field.
$storage_edit =
[ 'settings[comment_type]' => 'foobar',
];
$this->
fieldUIAddNewField('entity_test/structure/entity_test', 'foobar', 'Foobar', 'comment',
$storage_edit);
// Add a third comment field.
$this->
fieldUIAddNewField('entity_test/structure/entity_test', 'barfoo', 'BarFoo', 'comment',
$storage_edit);
// Check the field contains the correct comment type.
$field_storage = FieldStorageConfig::
load('entity_test.field_barfoo'
);
$this->
assertInstanceOf(FieldStorageConfig::
class,
$field_storage);
$this->
assertEquals('foobar',
$field_storage->
getSetting('comment_type'
));
$this->
assertEquals(1,
$field_storage->
getCardinality());
// Test the new entity commenting inherits default.