You are here

function simpletest_test_form_submit in Drupal 7

Run selected tests.

1 call to simpletest_test_form_submit()
simpletest_result_form_submit in modules/simpletest/simpletest.pages.inc
Re-run the tests that match the filter.

File

modules/simpletest/simpletest.pages.inc, line 183
Page callbacks for simpletest module.

Code

function simpletest_test_form_submit($form, &$form_state) {
  simpletest_classloader_register();

  // Get list of tests.
  $tests_list = array();
  foreach ($form_state['values'] as $class_name => $value) {

    // Since class_exists() will likely trigger an autoload lookup,
    // we do the fast check first.
    if ($value === 1 && class_exists($class_name)) {
      $tests_list[] = $class_name;
    }
  }
  if (count($tests_list) > 0) {
    $test_id = simpletest_run_tests($tests_list, 'drupal');
    $form_state['redirect'] = 'admin/config/development/testing/results/' . $test_id;
  }
  else {
    drupal_set_message(t('No test(s) selected.'), 'error');
  }
}