You are here

function honeypot_test_submit_form in Honeypot 7

Page callback: programmatically submit a form.

1 string reference to 'honeypot_test_submit_form'
honeypot_test_menu in tests/honeypot_test.module
Implements hook_menu().

File

tests/honeypot_test.module, line 18

Code

function honeypot_test_submit_form() {
  module_load_include('inc', 'user', 'user.pages');
  $form_state = array();
  $form_state['values'] = array(
    'name' => 'robo-user',
    'mail' => 'robouser@example.com',
    'op' => t('E-mail new password'),
  );
  drupal_form_submit('user_pass', $form_state);
  $errors = form_get_errors();
  print drupal_json_encode($errors);
  exit;
}