You are here

public function RulesFormsEventsTestCase::testFormBuilt in Rules Forms Support 7.2

Same name and namespace in other branches
  1. 7 rules_forms.test \RulesFormsEventsTestCase::testFormBuilt()

Tests the form built event.

File

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

Class

RulesFormsEventsTestCase
Tests Rules Forms events.

Code

public function testFormBuilt() {
  $rule = rules_reaction_rule();
  $rule
    ->event('rules_forms_article_node_form_form_built')
    ->action('drupal_message', array(
    'message' => 'Form built successful!',
  ));
  $this
    ->drupalGet('node/add/article');
  $this
    ->assertNoText('Form built successful!');
  $rule
    ->save('test');
  $this
    ->drupalGet('node/add/article');
  $this
    ->assertText('Form built successful!');
}