/**
  * {@inheritdoc}
  */
 public function submitForm(array &$form, array &$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_route']['route_name'] = 'simpletest.test_form';
         return;
     }
     $form_execute = array();
     $form_state_execute = array('values' => array());
     foreach ($classes as $class) {
         $form_state_execute['values']['tests'][$class] = $class;
     }
     // Submit the simpletest test form to rerun the tests.
     // Under normal circumstances, a form object's submitForm() should never be
     // called directly, FormBuilder::submitForm() should be called instead.
     // However, it sets $form_state['programmed'], which disables the Batch API.
     $simpletest_test_form = new SimpletestTestForm();
     $simpletest_test_form->buildForm($form_execute, $form_state_execute);
     $simpletest_test_form->submitForm($form_execute, $form_state_execute);
     $form_state['redirect_route'] = $form_state_execute['redirect_route'];
 }
 /**
  * {@inheritdoc}
  */
 public function submitForm(array &$form, FormStateInterface $form_state)
 {
     $pass = $form_state->getValue('filter_pass') ? explode(',', $form_state->getValue('filter_pass')) : array();
     $fail = $form_state->getValue('filter_fail') ? explode(',', $form_state->getValue('filter_fail')) : array();
     if ($form_state->getValue('filter') == 'all') {
         $classes = array_merge($pass, $fail);
     } elseif ($form_state->getValue('filter') == 'pass') {
         $classes = $pass;
     } else {
         $classes = $fail;
     }
     if (!$classes) {
         $form_state->setRedirect('simpletest.test_form');
         return;
     }
     $form_execute = array();
     $form_state_execute = new FormState();
     foreach ($classes as $class) {
         $form_state_execute->setValue(['tests', $class], $class);
     }
     // Submit the simpletest test form to rerun the tests.
     // Under normal circumstances, a form object's submitForm() should never be
     // called directly, FormBuilder::submitForm() should be called instead.
     // However, it calls $form_state->setProgrammed(), which disables the Batch API.
     $simpletest_test_form = new SimpletestTestForm();
     $simpletest_test_form->buildForm($form_execute, $form_state_execute);
     $simpletest_test_form->submitForm($form_execute, $form_state_execute);
     if ($redirect = $form_state_execute->getRedirect()) {
         $form_state->setRedirectUrl($redirect);
     }
 }