You are here

function simpletest_test_form_submit in SimpleTest 7

Same name and namespace in other branches
  1. 6.2 simpletest.pages.inc \simpletest_test_form_submit()
  2. 7.2 simpletest.pages.inc \simpletest_test_form_submit()

Run selected tests.

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

File

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

Code

function simpletest_test_form_submit($form, &$form_state) {

  // Get list of tests.
  $tests_list = array();
  foreach ($form_state['values'] as $class_name => $value) {
    if (class_exists($class_name) && $value === 1) {
      $tests_list[] = $class_name;
    }
  }
  if (count($tests_list) > 0) {
    simpletest_run_tests($tests_list, 'drupal');
  }
  else {
    drupal_set_message(t('No test(s) selected.'), 'error');
  }
}