You are here

function simpletest_result_form_submit in Drupal 7

Re-run the tests that match the filter.

File

modules/simpletest/simpletest.pages.inc, line 342
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);
  }
  elseif ($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);
  $form_state['redirect'] = $form_state_execute['redirect'];
}