function FileFieldTestCase::updateFileField
Updates an existing file field with new settings.
4 calls to FileFieldTestCase::updateFileField()
- FileFieldPathTestCase::testUploadPath in modules/
file/ tests/ file.test - Tests the normal formatter display on node display.
- FileFieldValidateTestCase::testFileExtension in modules/
file/ tests/ file.test - Tests file extension checking.
- FileFieldValidateTestCase::testFileMaxSize in modules/
file/ tests/ file.test - Tests the max file size validator.
- FileFieldWidgetTestCase::testWidgetValidation in modules/
file/ tests/ file.test - Tests validation with the Upload button.
File
-
modules/
file/ tests/ file.test, line 113
Class
- FileFieldTestCase
- Provides methods specifically for testing File module's field handling.
Code
function updateFileField($name, $type_name, $instance_settings = array(), $widget_settings = array()) {
$instance = field_info_instance('node', $name, $type_name);
$instance['settings'] = array_merge($instance['settings'], $instance_settings);
$instance['widget']['settings'] = array_merge($instance['widget']['settings'], $widget_settings);
field_update_instance($instance);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.