You are here

protected function PdfParseTest::getExpectedFieldCount in FillPDF 5.0.x

Same name and namespace in other branches
  1. 8.4 tests/src/Functional/PdfParseTest.php \Drupal\Tests\fillpdf\Functional\PdfParseTest::getExpectedFieldCount()

Get expected field count per backend.

Different backends process different types of fields. This method is used by ::backendTest() to assert against the correct value.

Parameters

string $backend: The backend.

Return value

int The expected field count.

1 call to PdfParseTest::getExpectedFieldCount()
PdfParseTest::backendTest in tests/src/Functional/PdfParseTest.php
Tests a backend.

File

tests/src/Functional/PdfParseTest.php, line 139

Class

PdfParseTest
Tests PDF parsing.

Namespace

Drupal\Tests\fillpdf\Functional

Code

protected function getExpectedFieldCount($backend) {

  // NOTE: Other bugs led me to believe this was the case, but it's kind of a
  // useful method, so I'm just leaving it for now.
  switch ($backend) {
    case 'local_service':
    case 'pdftk':
      return 12;
  }
  throw new \LogicException("Unexpected call to PdfParseTest::getExpectedFieldCount() with \$backend = {$backend}");
}