function _file_test_form in SimpleTest 7
Form to test file uploads.
1 string reference to '_file_test_form'
- file_test_menu in tests/
file_test.module - Implement hook_menu().
File
- tests/
file_test.module, line 46 - Helper module for the file tests.
Code
function _file_test_form($form, &$form_state) {
$form['file_test_upload'] = array(
'#type' => 'file',
'#title' => t('Upload an image'),
);
$form['file_test_replace'] = array(
'#type' => 'select',
'#title' => t('Replace existing image'),
'#options' => array(
FILE_EXISTS_RENAME => t('Appends number until name is unique'),
FILE_EXISTS_REPLACE => t('Replace the existing file'),
FILE_EXISTS_ERROR => t('Fail with an error'),
),
'#default_value' => FILE_EXISTS_RENAME,
);
$form['file_subdir'] = array(
'#type' => 'textfield',
'#title' => 'Subdirectory for test image',
'#default_value' => '',
);
$form['submit'] = array(
'#type' => 'submit',
'#value' => t('Submit'),
);
return $form;
}