You are here

public function RulesFormsActionsTestCase::testestDisabledAction in Rules Forms Support 7.2

Tests callback for Action: Disable form element.

File

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

Class

RulesFormsActionsTestCase
Tests Rules Forms actions.

Code

public function testestDisabledAction() {
  $form = array();
  $form['test'] = array(
    '#type' => 'textfield',
    '#disabled' => FALSE,
  );
  $form = new ArrayObject($form);
  $action = rules_action('rules_forms_set_disabled', array(
    'element' => 'textfield:test',
    'disabled' => 1,
  ));
  $action
    ->executeByArgs(array(
    'form' => $form,
  ));
  $this
    ->assertTrue($form['test']['#disabled']);
}