You are here

function FileFieldTestCase::updateFileField in Drupal 7

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
Tests for file.module.

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);
}