function simpletest_test_form_submit in SimpleTest 7.2
Same name and namespace in other branches
- 6.2 simpletest.pages.inc \simpletest_test_form_submit()
- 7 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 195 - Page callbacks for simpletest module.
Code
function simpletest_test_form_submit($form, &$form_state) {
// Get list of tests.
$tests_list = array();
$not_found = FALSE;
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;
}
else {
$not_found = TRUE;
}
}
if ($not_found) {
drupal_flush_all_caches();
drupal_set_message(t('One or more of the test classes was not found. The cache has been cleared to correct the issue.'), 'error');
}
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');
}
}