You are here

public function RulesFormsActionsTestCase::testSetDescriptionAction in Rules Forms Support 7

Tests callback for Action: Set element description.

File

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

Class

RulesFormsActionsTestCase
Tests Rules Forms actions.

Code

public function testSetDescriptionAction() {
  $form = array();
  $form['test'] = array(
    '#type' => 'textfield',
    '#description' => t('tset'),
  );
  $form = new ArrayObject($form);
  $action = rules_action('rules_forms_set_description', array(
    'element' => 'textfield:test',
    'description' => 'test',
  ));
  $action
    ->executeByArgs(array(
    'form' => $form,
  ));
  $this
    ->assertEqual($form['test']['#description'], 'test');
}