Asserts field settings are as expected.
$bundle: The bundle name for the instance.
$field_name: The field name for the instance.
$string: The settings text.
$entity_type: The entity type for the instance.
function assertFieldSettings($bundle, $field_name, $string = 'dummy test string', $entity_type = 'node') {
// Reset the fields info.
field_info_cache_clear();
// Assert field settings.
$field = field_info_field($field_name);
$this
->assertTrue($field['settings']['test_field_setting'] == $string, 'Field settings were found.');
// Assert instance and widget settings.
$instance = field_info_instance($entity_type, $field_name, $bundle);
$this
->assertTrue($instance['settings']['test_instance_setting'] == $string, 'Field instance settings were found.');
$this
->assertTrue($instance['widget']['settings']['test_widget_setting'] == $string, 'Field widget settings were found.');
}