You are here

function simpletest_overview_form_submit in SimpleTest 5

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

FAPI form submit for simpletest_overview_form

Parameters

$form_id :

$form_values:

File

./simpletest.module, line 137

Code

function simpletest_overview_form_submit($form_id, $form_values) {
  switch ($form_values['running_options']) {
    case 'all_tests':
      $output = simpletest_run_tests();
      break;
    case 'selected_tests':
      $test_list = array();
      foreach ($form_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);
      }
      else {

        // no test has been selected
        drupal_set_message(t('No test has been selected.'), 'error');
      }
      break;
    default:
      drupal_set_message(t('No test has been selected.'), 'error');
  }
  simpletest_running_output($output);
  return FALSE;
}