You are here

protected function YamlFormTestTrait::postSubmissionTest in YAML Form 8

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

2 calls to YamlFormTestTrait::postSubmissionTest()
YamlFormResultsExportTest::testDownloadFiles in src/Tests/YamlFormResultsExportTest.php
Tests download files.
YamlFormSubmissionFormSettingsTest::testSettings in src/Tests/YamlFormSubmissionFormSettingsTest.php
Tests form setting including confirmation.

File

src/Tests/YamlFormTestTrait.php, line 180

Class

YamlFormTestTrait
Defines form test trait.

Namespace

Drupal\yamlform\Tests

Code

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