You are here

public function RulesFormsAPITestCase::testEventSubmit in Rules Forms Support 7.2

Same name and namespace in other branches
  1. 7 rules_forms.test \RulesFormsAPITestCase::testEventSubmit()

Tests rules_forms_event_submit().

File

./rules_forms.test, line 835
Rules Forms Support tests.

Class

RulesFormsAPITestCase
Tests Rules Forms actions.

Code

public function testEventSubmit() {
  variable_set('rules_forms_form_info', self::$formInfo);

  // Ensure that the session variables are unset for the form.
  $formId = self::$form['form_id']['#value'];
  $_SESSION['rules_forms_form_values'][$formId] = array(
    'textfield:title' => 'test',
    'textarea:body:und:0:value' => 'test',
  );
  rules_forms_event_submit(self::$form, self::$formState);
  $this
    ->assertFalse(isset($_SESSION['rules_forms_form_values'][$formId]), 'Ensure the session variable is unset.');
}