public function RulesFormsActionsTestCase::testSetRequiredAction in Rules Forms Support 7
Tests callback for Action: Require form element.
File
- ./
rules_forms.test, line 579 - Stores tests related to Rules Form.
Class
- RulesFormsActionsTestCase
- Tests Rules Forms actions.
Code
public function testSetRequiredAction() {
$form = array();
$form['test'] = array(
'#type' => 'textfield',
'#required' => FALSE,
);
$form = new ArrayObject($form);
$action = rules_action('rules_forms_set_required', array(
'element' => 'textfield:test',
'require' => 1,
));
$action
->executeByArgs(array(
'form' => $form,
));
$this
->assertTrue($form['test']['#required']);
}