class FieldTypePluginManagerTest extends FieldKernelTestBase
{ /**
* Tests the default settings convenience methods.
*/
public function testDefaultSettings() { $field_type_manager = \Drupal::
service('plugin.manager.field.field_type'
);
foreach (['test_field', 'shape', 'hidden_test_field'
] as $type) { $definition =
$field_type_manager->
getDefinition($type);
$this->
assertSame($field_type_manager->
getDefaultStorageSettings($type),
$definition['class'
]::
defaultStorageSettings(),
new FormattableMarkup("%type storage settings were returned",
['%type' =>
$type]));
$this->
assertSame($field_type_manager->
getDefaultFieldSettings($type),
$definition['class'
]::
defaultFieldSettings(),
new FormattableMarkup(" %type field settings were returned",
['%type' =>
$type]));
} } /**
* Tests creation of field item instances.
*/
public function testCreateInstance() { /** @var \Drupal\Core\Field\FieldTypePluginManagerInterface $field_type_manager */
$field_type_manager = \Drupal::
service('plugin.manager.field.field_type'
);
foreach (['test_field', 'shape', 'hidden_test_field'
] as $type) { $definition =
$field_type_manager->
getDefinition($type);