public function RulesFormsEventsTestCase::testButtonSubmit in Rules Forms Support 7
Same name and namespace in other branches
- 7.2 rules_forms.test \RulesFormsEventsTestCase::testButtonSubmit()
Tests the button submit event.
File
- ./
rules_forms.test, line 333 - Stores tests related to Rules Form.
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!');
}