You are here

public function RulesFormsActionsTestCase::testestTitleAction in Rules Forms Support 7.2

Tests callback for Action: Set element title.

File

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

Class

RulesFormsActionsTestCase
Tests Rules Forms actions.

Code

public function testestTitleAction() {
  $form = array();
  $form['test'] = array(
    '#type' => 'textfield',
    '#title' => 'test',
  );
  $form = new ArrayObject($form);
  $action = rules_action('rules_forms_set_title', array(
    'element' => 'textfield:test',
    'title' => 'test',
  ));
  $action
    ->executeByArgs(array(
    'form' => $form,
  ));
  $this
    ->assertEqual($form['test']['#title'], 'test');
}