function simpletest_result_form_submit in SimpleTest 7
Same name and namespace in other branches
- 6.2 simpletest.pages.inc \simpletest_result_form_submit()
- 7.2 simpletest.pages.inc \simpletest_result_form_submit()
Re-run the tests that match the filter.
File
- ./
simpletest.pages.inc, line 334 - Page callbacks for simpletest module.
Code
function simpletest_result_form_submit($form, &$form_state) {
$pass = $form_state['values']['filter_pass'] ? explode(',', $form_state['values']['filter_pass']) : array();
$fail = $form_state['values']['filter_fail'] ? explode(',', $form_state['values']['filter_fail']) : array();
if ($form_state['values']['filter'] == 'all') {
$classes = array_merge($pass, $fail);
}
else {
if ($form_state['values']['filter'] == 'pass') {
$classes = $pass;
}
else {
$classes = $fail;
}
}
if (!$classes) {
$form_state['redirect'] = 'admin/config/development/testing';
return;
}
$form_state_execute = array(
'values' => array(),
);
foreach ($classes as $class) {
$form_state_execute['values'][$class] = 1;
}
simpletest_test_form_submit(array(), $form_state_execute);
}