public function RulesFormsAPITestCase::testEventBuild in Rules Forms Support 7.2
Same name and namespace in other branches
- 7 rules_forms.test \RulesFormsAPITestCase::testEventBuild()
Tests rules_forms_event_build().
File
- ./
rules_forms.test, line 821 - Rules Forms Support tests.
Class
- RulesFormsAPITestCase
- Tests Rules Forms actions.
Code
public function testEventBuild() {
variable_set('rules_forms_form_info', self::$formInfo);
$formId = self::$form['form_id']['#value'];
rules_forms_event_build(self::$form, self::$formState, $formId);
foreach (self::$formInfo[$formId]['elements'] as $element_id => $info) {
$this
->assertTrue(isset($_SESSION['rules_forms_form_values'][$formId][$element_id]), 'Ensure the session variable was set for the element.');
// Values should always be 'test' whether it came from.
$this
->assertTrue($_SESSION['rules_forms_form_values'][$formId][$element_id] == 'test');
}
}