You are here

function simpletest_overview_form_submit in SimpleTest 6

Same name and namespace in other branches
  1. 5 simpletest.module \simpletest_overview_form_submit()

FAPI form submit for simpletest_overview_form

_state

Parameters

$form:

File

./simpletest.module, line 109

Code

function simpletest_overview_form_submit($form, &$form_state) {
  $form_state['redirect'] = FALSE;
  $output = '';
  switch ($form_state['values']['running_options']) {
    case 'all_tests':
      $output = simpletest_run_tests();
      break;
    case 'selected_tests':
      $tests_list = array();
      foreach ($form_state['values'] as $item => $value) {
        if ($value === 1 && strpos($item, 'selectall') === FALSE) {
          $tests_list[] = $item;
        }
      }
      if (count($tests_list) > 0) {
        $output = simpletest_run_tests($tests_list);
        break;
      }

    // Fall through
    default:
      simpletest_trigger_error('no tests selected');
  }
  simpletest_running_output($output);
  return FALSE;
}