public function RulesFormsEventsTestCase::testButtonSubmit in Rules Forms Support 7.2
Same name and namespace in other branches
- 7 rules_forms.test \RulesFormsEventsTestCase::testButtonSubmit()
Tests the button submit event.
File
- ./
rules_forms.test, line 320 - Rules Forms Support tests.
Class
- RulesFormsEventsTestCase
- Tests Rules Forms events.
Code
public function testButtonSubmit() {
$rule = rules_reaction_rule();
$rule
->event('rules_forms_article_node_form_button_submit_actions_submit_submit')
->action('drupal_message', array(
'message' => 'Button level submit successful!',
));
$edit = array();
$edit['title'] = 'test';
$this
->drupalPost('node/add/article', $edit, t('Save'));
$this
->assertNoText('Button level submit successful!');
$rule
->save('test');
$this
->drupalPost('node/add/article', $edit, t('Save'));
$this
->assertText('Button level submit successful!');
}