protected function WebformBrowserTestTrait::postSubmissionTest in Webform 6.x
Same name and namespace in other branches
- 8.5 tests/src/Traits/WebformBrowserTestTrait.php \Drupal\Tests\webform\Traits\WebformBrowserTestTrait::postSubmissionTest()
Post a new test submission to a webform.
Parameters
\Drupal\webform\WebformInterface $webform: A webform.
array $edit: Submission values.
string $submit: Value of the submit button whose click is to be emulated.
array $options: Options to be forwarded to the url generator.
Return value
int The created test submission's sid.
22 calls to WebformBrowserTestTrait::postSubmissionTest()
- WebformAttachmentTest::testWebformAttachment in modules/
webform_attachment/ tests/ src/ Functional/ WebformAttachmentTest.php - Tests webform attachment.
- WebformBlockContextTest::testBlockContext in tests/
src/ Functional/ Block/ WebformBlockContextTest.php - Tests webform block context.
- WebformBrowserTestBaseTest::testWebformBase in tests/
src/ Functional/ WebformBrowserTestBaseTest.php - Test base helper methods.
- WebformElementFormatTest::testFormat in tests/
src/ Functional/ Element/ WebformElementFormatTest.php - Tests element format.
- WebformElementManagedFileImageTest::testImageFileUpload in tests/
src/ Functional/ Element/ WebformElementManagedFileImageTest.php - Test image file upload.
File
- tests/
src/ Traits/ WebformBrowserTestTrait.php, line 289
Class
- WebformBrowserTestTrait
- Provides convenience methods for webform assertions in browser tests.
Namespace
Drupal\Tests\webform\TraitsCode
protected function postSubmissionTest(WebformInterface $webform, array $edit = [], $submit = NULL, array $options = []) {
$submit = $this
->getWebformSubmitButtonLabel($webform, $submit);
$this
->drupalPostForm('/webform/' . $webform
->id() . '/test', $edit, $submit, $options);
return $this
->getLastSubmissionId($webform);
}