You are here

public function FillPdfWebformTestCase::testLegacyWebformLink in FillPDF 7

Test fillpdf_pdf_link() with a single webform in legacy format.

Fillpdf_pdf_link() accepts a single array of webform and submission being passed in as $webform_arr. We're therefore separately testing single webform cases in this legacy format. All other cases are fully covered by testWebformLink().

File

tests/FillPdfWebformTestCase.test, line 88

Class

FillPdfWebformTestCase
Tests parsing links.

Code

public function testLegacyWebformLink() {
  foreach ($this
    ->dataProvider() as $test_case) {
    list($name, $webforms, $expected) = $test_case;
    if (count($webforms) == 1) {
      $webform = reset($webforms);
      $webform_arr = array(
        'nid' => $webform['webform']->nid,
        'sid' => $webform['submission']->sid,
      );

      // fillpdf_pdf_link() also accepts a single webform.
      $output = rawurldecode(fillpdf_pdf_link(1, NULL, $webform_arr));
      $this
        ->assertEqual($expected, $output, t($this->message, array(
        '%name' => $name . ' (legacy format)',
        '%output' => $output,
        '%expected' => $expected,
      )));
    }
  }
}