You are here

public function FillPdfWebformTestCase::dataProvider in FillPDF 7

Data provider for testWebformLink() and testLegacyWebformLink().

Return value

array Array of test cases.

2 calls to FillPdfWebformTestCase::dataProvider()
FillPdfWebformTestCase::testLegacyWebformLink in tests/FillPdfWebformTestCase.test
Test fillpdf_pdf_link() with a single webform in legacy format.
FillPdfWebformTestCase::testWebformLink in tests/FillPdfWebformTestCase.test
Test fillpdf_context_to_link() with webforms.

File

tests/FillPdfWebformTestCase.test, line 116

Class

FillPdfWebformTestCase
Tests parsing links.

Code

public function dataProvider() {
  $base_url = url('fillpdf', array(
    'query' => array(
      'fid' => 1,
    ),
    'absolute' => TRUE,
  ));
  $test_cases = array();

  // Test case: single webform.
  $test_cases[] = array(
    'Single webform',
    array(
      reset($this->webforms),
    ),
    $base_url . '&webform[nid]=111&webform[sid]=211',
  );

  // Test case: multiple webforms.
  $test_cases[] = array(
    'Multiple webforms',
    $this->webforms,
    $base_url . '&webforms[0][nid]=111&webforms[0][sid]=211&webforms[1][nid]=112&webforms[1][sid]=212&webforms[2][nid]=113&webforms[2][sid]=213',
  );

  // Test case: multiple webforms in reverse order.
  $test_cases[] = array(
    'Multiple webforms (in reverse order)',
    array_reverse($this->webforms),
    $base_url . '&webforms[0][nid]=113&webforms[0][sid]=213&webforms[1][nid]=112&webforms[1][sid]=212&webforms[2][nid]=111&webforms[2][sid]=211',
  );
  return $test_cases;
}