// defer actual $field comparison to a helper function, used for the two cases above
/**
* Tests the creation of a field storage.
*/
public function testCreate() { $field_storage_definition =
[ 'field_name' => 'field_2',
'entity_type' => 'entity_test',
'type' => 'test_field',
];
field_test_memorize();
$field_storage = FieldStorageConfig::
create($field_storage_definition);
$field_storage->
save();
$field_storage = FieldStorageConfig::
load($field_storage->
id());
$this->
assertEquals('TRUE',
$field_storage->
getSetting('storage_setting_from_config_data'
));
$this->
assertNull($field_storage->
getSetting('config_data_from_storage_setting'
));
$mem =
field_test_memorize();
$this->
assertSame($field_storage_definition['field_name'
],
$mem['field_test_field_storage_config_create'
][0
][0
]->
getName(), 'hook_entity_create() called with correct arguments.'
);
$this->
assertSame($field_storage_definition['type'
],
$mem['field_test_field_storage_config_create'
][0
][0
]->
getType(), 'hook_entity_create() called with correct arguments.'
);