You are here

public function FillPdfWebformTestCase::testWebformLink in FillPDF 7

Test fillpdf_context_to_link() with webforms.

File

tests/FillPdfWebformTestCase.test, line 54

Class

FillPdfWebformTestCase
Tests parsing links.

Code

public function testWebformLink() {
  $base_context = array(
    'nodes' => array(),
    'webforms' => array(),
    'uc_orders' => array(),
    'uc_order_products' => array(),
    'entities' => array(),
  );
  foreach ($this
    ->dataProvider() as $test_case) {
    list($name, $webforms, $expected) = $test_case;

    // Ensure links were correctly created from context.
    $context = array(
      'webforms' => $webforms,
    ) + $base_context;
    $output = rawurldecode(fillpdf_context_to_link(1, $context));
    $this
      ->assertEqual($expected, $output, t($this->message, array(
      '%name' => $name,
      '%output' => $output,
      '%expected' => $expected,
    )));
  }
}