function form_test_drupal_form_submit_batch_api in SimpleTest 7
Page callback for the batch/drupal_form_submit interaction test.
When called without any arguments we set up a batch that calls form_test_batch_callback. That function will submit a form using drupal_form_submit using the values specified in this function.
The form's field test_value begins at 'initial_value', and is changed to 'form_submitted' when the form is submitted successfully. On completion this function is passed 'done' to complete the process.
1 string reference to 'form_test_drupal_form_submit_batch_api'
- form_test_menu in tests/
form_test.module - Implement hook_menu().
File
- tests/
form_test.module, line 216 - Helper module for the form API tests.
Code
function form_test_drupal_form_submit_batch_api($arg = '') {
// If we're at the end of the batch process, return.
if ($arg == 'done') {
return t('Done');
}
// Otherwise set up the batch.
$batch['operations'] = array(
array(
'form_test_batch_callback',
array(
'form_submitted',
),
),
);
// Set the batch and process it.
batch_set($batch);
batch_process('form_test/drupal_form_submit_batch_api/done');
}