_file_test_form($form, &$form_state)Form to test file uploads.
modules/simpletest/tests/file_test.module, line 46
<?php
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;
}
?>