function ContentMigrateListTestCase::setupField in Content Construction Kit (CCK) 7.3
Slightly different from setupField in text case.
Overrides ContentMigrateTestCase::setupField
1 call to ContentMigrateListTestCase::setupField()
- ContentMigrateListTestCase::testSelectListMigration in modules/
content_migrate/ tests/ content_migrate.test
File
- modules/
content_migrate/ tests/ content_migrate.test, line 532 - Content Migrate Test Cases
Class
- ContentMigrateListTestCase
- @class List widget functional test case
Code
function setupField($type, $widget, $multiple, $required, $default, $values) {
$field = parent::setupField($type, $widget, $multiple, $required, $default);
$field['widget_module'] = 'optionwidgets';
$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'] = '';
$i = 0;
foreach ($values['value'] as $name => $val) {
if ($i != 0) {
$field['global_settings']['allowed_values'] .= "\n";
}
$field['global_settings']['allowed_values'] .= $name . '|' . $val;
$i++;
}
$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;
}