function FileFieldTestCase::updateFileField

7.x file.test FileFieldTestCase::updateFileField($name, $type_name, $instance_settings = array(), $widget_settings = array())

Updates an existing file field with new settings.

3 calls to FileFieldTestCase::updateFileField()
FileFieldPathTestCase::testUploadPath in drupal-7.x/modules/file/tests/file.test
Tests the normal formatter display on node display.
FileFieldValidateTestCase::testFileExtension in drupal-7.x/modules/file/tests/file.test
Tests file extension checking.
FileFieldValidateTestCase::testFileMaxSize in drupal-7.x/modules/file/tests/file.test
Tests the max file size validator.

File

drupal-7.x/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);
}