function FieldTypePluginManagerTest::testDefaultSettings in Zircon Profile 8.0
Same name and namespace in other branches
- 8 core/modules/field/src/Tests/FieldTypePluginManagerTest.php \Drupal\field\Tests\FieldTypePluginManagerTest::testDefaultSettings()
Tests the default settings convenience methods.
File
- core/
modules/ field/ src/ Tests/ FieldTypePluginManagerTest.php, line 24 - Contains \Drupal\field\Tests\FieldTypePluginManagerTest.
Class
- FieldTypePluginManagerTest
- Tests the field type manager.
Namespace
Drupal\field\TestsCode
function testDefaultSettings() {
$field_type_manager = \Drupal::service('plugin.manager.field.field_type');
foreach (array(
'test_field',
'shape',
'hidden_test_field',
) as $type) {
$definition = $field_type_manager
->getDefinition($type);
$this
->assertIdentical($field_type_manager
->getDefaultStorageSettings($type), $definition['class']::defaultStorageSettings(), format_string("%type storage settings were returned", array(
'%type' => $type,
)));
$this
->assertIdentical($field_type_manager
->getDefaultFieldSettings($type), $definition['class']::defaultFieldSettings(), format_string(" %type field settings were returned", array(
'%type' => $type,
)));
}
}