You are here

public function RulesFormsEventsTestCase::testFormBuilt in Rules Forms Support 7

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

Tests the form built event.

File

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

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!');
}