public function RulesFormsAPITestCase::testEventBuild in Rules Forms Support 7
Same name and namespace in other branches
- 7.2 rules_forms.test \RulesFormsAPITestCase::testEventBuild()
Tests rules_forms_event_build().
File
- ./
rules_forms.test, line 796 - Stores tests related to Rules Form.
Class
- RulesFormsAPITestCase
- Tests Rules Forms actions.
Code
public function testEventBuild() {
variable_set('rules_forms_form_info', self::$formInfo);
$form_id = self::$form['form_id']['#value'];
rules_forms_event_build(self::$form, self::$formState, $form_id);
foreach (self::$formInfo[$form_id]['elements'] as $element_id => $info) {
$this
->assertTrue(isset(self::$formState['rules_forms']['form_values'][$element_id]), 'Ensure the build information variable was set for the element.');
// Values should always be set to 'tset' regardless if it came from
// #value or #default_value.
$this
->assertTrue(self::$formState['rules_forms']['form_values'][$element_id] == 'tset');
}
}