You are here

public function RulesFormsActionsTestCase::testestDescriptionAction in Rules Forms Support 7.2

Tests callback for Action: Set element description.

File

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

Class

RulesFormsActionsTestCase
Tests Rules Forms actions.

Code

public function testestDescriptionAction() {
  $form = array();
  $form['test'] = array(
    '#type' => 'textfield',
    '#description' => t('test'),
  );
  $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');
}