You are here

public function RulesFormsActionsTestCase::testHideAction in Rules Forms Support 7

Same name and namespace in other branches
  1. 7.2 rules_forms.test \RulesFormsActionsTestCase::testHideAction()

Tests callback for Action: Hide form element.

File

./rules_forms.test, line 555
Stores tests related to Rules Form.

Class

RulesFormsActionsTestCase
Tests Rules Forms actions.

Code

public function testHideAction() {
  $form = array();
  $form['test'] = array(
    '#type' => 'textfield',
    '#access' => FALSE,
  );
  $form = new ArrayObject($form);
  $action = rules_action('rules_forms_set_access', array(
    'element' => 'textfield:test',
    'access' => 1,
  ));
  $action
    ->executeByArgs(array(
    'form' => $form,
  ));
  $this
    ->assertFalse($form['test']['#access']);
}