You are here

protected function YamlFormTestTrait::getExport in YAML Form 8

Request a form results export CSV.

Parameters

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

array $options: An associative array of export options.

2 calls to YamlFormTestTrait::getExport()
YamlFormElementTableTest::test in src/Tests/YamlFormElementTableTest.php
Tests building of options elements.
YamlFormResultsExportTest::testExportOptions in src/Tests/YamlFormResultsExportTest.php
Tests export options.

File

src/Tests/YamlFormTestTrait.php, line 401

Class

YamlFormTestTrait
Defines form test trait.

Namespace

Drupal\yamlform\Tests

Code

protected function getExport(YamlFormInterface $yamlform, array $options = []) {

  /** @var \Drupal\yamlform\YamlFormSubmissionExporterInterface $exporter */
  $exporter = \Drupal::service('yamlform_submission.exporter');
  $options += $exporter
    ->getDefaultExportOptions();
  $this
    ->drupalGet('admin/structure/yamlform/manage/' . $yamlform
    ->id() . '/results/download', [
    'query' => $options,
  ]);
}