You are here

protected function WebformBrowserTestTrait::postSubmission in Webform 6.x

Same name and namespace in other branches
  1. 8.5 tests/src/Traits/WebformBrowserTestTrait.php \Drupal\Tests\webform\Traits\WebformBrowserTestTrait::postSubmission()

Post a new 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 submission's sid.

91 calls to WebformBrowserTestTrait::postSubmission()
WebformAccessEntityRulesTest::testAccessRules in tests/src/Functional/Access/WebformAccessEntityRulesTest.php
Tests webform entity access rules.
WebformAccessSubmissionPermissionsTest::testPermissions in tests/src/Functional/Access/WebformAccessSubmissionPermissionsTest.php
Test webform submission access permissions.
WebformAttachmentTest::testWebformAttachment in modules/webform_attachment/tests/src/Functional/WebformAttachmentTest.php
Tests webform attachment.
WebformBrowserTestBaseTest::testWebformBase in tests/src/Functional/WebformBrowserTestBaseTest.php
Test base helper methods.
WebformCompositeFormatTest::testFormat in tests/src/Functional/Composite/WebformCompositeFormatTest.php
Tests element format.

... See full list

File

tests/src/Traits/WebformBrowserTestTrait.php, line 268

Class

WebformBrowserTestTrait
Provides convenience methods for webform assertions in browser tests.

Namespace

Drupal\Tests\webform\Traits

Code

protected function postSubmission(WebformInterface $webform, array $edit = [], $submit = NULL, array $options = []) {
  $submit = $this
    ->getWebformSubmitButtonLabel($webform, $submit);
  $this
    ->drupalPostForm('/webform/' . $webform
    ->id(), $edit, $submit, $options);
  return $this
    ->getLastSubmissionId($webform);
}