protected function EntityformTestCase::entityformSubmit in Entityform 7.2
Same name and namespace in other branches
- 7 entityform.test \EntityformTestCase::entityformSubmit()
1 call to EntityformTestCase::entityformSubmit()
File
- ./
entityform.test, line 36
Class
Code
protected function entityformSubmit($machine_name, $user, $submit_text = NULL) {
$this
->drupalLogin($user);
if (empty($submit_text)) {
$submit_text = 'submitext-' . $user->name;
}
$form_url = 'eform/submit/' . str_replace('_', '-', $machine_name);
$this
->drupalGet($form_url);
$this
->assertText(t('Test Instructions'), 'Authenicated has access to Test Form.');
$this
->assertText(t('Test Field'), 'field_text exists on Test Form.');
// Post Test Form
$edit = array();
$edit['field_text[und][0][value]'] = $submit_text;
$this
->drupalPost($form_url, $edit, t(ENTITYFORM_TEST_SUBMIT_TEXT));
$entityform_type = entityform_type_load($machine_name);
if ($entityform_type->data['redirect_path'] == '') {
if ($this
->assertText(t(ENTITYFORM_TEST_SUBMISSION_TITLE), 'Authenicated user can submit.')) {
$this->entityform_submission_count++;
return TRUE;
}
return FALSE;
}
}