function ContentMigrateTextTestCase::setupField in Content Construction Kit (CCK) 7.3
Setup a field definition array based on parameters.
Parameters
$type the field type.:
$widget the widget type.:
$multiple an integer referring to the field setting of that name.:
$required should the field be required?:
$default the default value to use.:
Return value
$field field definition array
Overrides ContentMigrateTestCase::setupField
4 calls to ContentMigrateTextTestCase::setupField()
- ContentMigrateTextTestCase::testMultiNodeTextMigrate in modules/
content_migrate/ tests/ content_migrate.test - Test multiple node import of a text field.
- ContentMigrateTextTestCase::testMultiRevisionTextFieldMigration in modules/
content_migrate/ tests/ content_migrate.test - Test multiple revision text field migration to Drupal 7.
- ContentMigrateTextTestCase::testMultiValueTextFieldMigration in modules/
content_migrate/ tests/ content_migrate.test - Test multiple valued text fields.
- ContentMigrateTextTestCase::testTextFieldMigration in modules/
content_migrate/ tests/ content_migrate.test - Test text field migration to Drupal 7.
File
- modules/
content_migrate/ tests/ content_migrate.test, line 269 - Content Migrate Test Cases
Class
- ContentMigrateTextTestCase
- @class Content Migrate Text Test Case.
Code
function setupField($type, $widget, $multiple, $required, $default) {
$field = parent::setupField($type, $widget, $multiple, $required, $default);
$field['widget_module'] = 'text';
$field['widget_settings']['rows'] = 5;
$field['widget_settings']['size'] = '60';
$field['global_settings']['text_processing'] = '0';
$field['global_settings']['max_length'] = '';
$field['global_settings']['allowed_values'] = '';
$field['global_settings']['allowed_values_php'] = '';
$field['db_columns']['value']['type'] = 'text';
$field['db_columns']['value']['size'] = 'big';
$field['db_columns']['value']['not null'] = false;
$field['db_columns']['value']['sortable'] = true;
$field['db_columns']['value']['views'] = true;
if ($multiple != 0) {
$field['db_storage'] = 0;
}
return $field;
}