You are here

public static function TestFillPdfBackend::getParseResult in FillPDF 8.4

Returns a list of fields, as if a PDF file was parsed.

Note that there is a duplicate field that get consolidated in InputHelper::attachPdfToForm() at the latest. The expected number of fields is therefore three, not four.

Return value

array List of associative arrays representing fields.

See also

\Drupal\fillpdf\InputHelper::attachPdfToForm()

2 calls to TestFillPdfBackend::getParseResult()
PdfPopulationTest::testPluginApi in tests/src/Functional/PdfPopulationTest.php
Test plugin APIs directly to make sure third-party consumers can use them.
TestFillPdfBackend::parse in tests/modules/fillpdf_test/src/Plugin/FillPdfBackend/TestFillPdfBackend.php
Parse a PDF and return a list of its fields.

File

tests/modules/fillpdf_test/src/Plugin/FillPdfBackend/TestFillPdfBackend.php, line 98

Class

TestFillPdfBackend
Backend used in tests.

Namespace

Drupal\fillpdf_test\Plugin\FillPdfBackend

Code

public static function getParseResult() {
  return [
    0 => [
      'name' => 'ImageField',
      'value' => '',
      'type' => 'Pushbutton',
    ],
    1 => [
      'name' => 'TestButton',
      'value' => '',
      'type' => 'Pushbutton',
    ],
    2 => [
      'name' => 'TextField1',
      'value' => '',
      'type' => 'Text',
    ],
    3 => [
      'name' => 'TextField2',
      'value' => '',
      'type' => 'Text',
    ],
    4 => [
      'name' => 'ImageField',
      'value' => '',
      'type' => 'Pushbutton',
    ],
  ];
}