You are here

protected function YamlFormTestTrait::postSubmission in YAML Form 8

Post a new submission to a form.

Parameters

\Drupal\yamlform\YamlFormInterface $yamlform: A form.

array $edit: Submission values.

string $submit: Value of the submit button whose click is to be emulated.

Return value

int The created submission's sid.

16 calls to YamlFormTestTrait::postSubmission()
YamlFormAccessTest::testAccessRules in src/Tests/YamlFormAccessTest.php
Tests form access rules.
YamlFormDraftTest::testDraftWithAutosave in src/Tests/YamlFormDraftTest.php
Test form draft with autosave.
YamlFormElementAccessTest::testElementAccess in src/Tests/YamlFormElementAccessTest.php
Test element access.
YamlFormElementFormatTest::testElementFormat in src/Tests/YamlFormElementFormatTest.php
Tests element format.
YamlFormElementManagedFileTest::checkFileUpload in src/Tests/YamlFormElementManagedFileTest.php
Check file upload.

... See full list

File

src/Tests/YamlFormTestTrait.php, line 161

Class

YamlFormTestTrait
Defines form test trait.

Namespace

Drupal\yamlform\Tests

Code

protected function postSubmission(YamlFormInterface $yamlform, array $edit = [], $submit = NULL) {
  $submit = $submit ?: t('Submit');
  $this
    ->drupalPostForm('yamlform/' . $yamlform
    ->id(), $edit, $submit);
  return $this
    ->getLastSubmissionId($yamlform);
}