You are here

public static function TestPdfBackend::getParseResult in FillPDF 5.0.x

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 TestPdfBackend::getParseResult()
PdfPopulationTest::testDuplicateFieldHandling in tests/src/Functional/PdfPopulationTest.php
Test that duplicate fields get filtered out.
TestPdfBackend::parseStream in tests/modules/fillpdf_test/src/Plugin/PdfBackend/TestPdfBackend.php
Parse a PDF and return a list of its fields.

File

tests/modules/fillpdf_test/src/Plugin/PdfBackend/TestPdfBackend.php, line 112

Class

TestPdfBackend
Backend used in tests.

Namespace

Drupal\fillpdf_test\Plugin\PdfBackend

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',
    ],
  ];
}