You are here

public function ParseEntityIdsTest::testEntityIds in FillPDF 8.4

Same name and namespace in other branches
  1. 5.0.x tests/src/Unit/LinkManipulator/ParseEntityIdsTest.php \Drupal\Tests\fillpdf\Unit\LinkManipulator\ParseEntityIdsTest::testEntityIds()

Tests parsing entity IDs from query parameters and back.

@covers ::parseEntityIds @covers ::prepareEntityIds

@dataProvider providerTestEntityIds

Parameters

array $input: Input query parameters.

array $expected: Expected output query parameters.

File

tests/src/Unit/LinkManipulator/ParseEntityIdsTest.php, line 28

Class

ParseEntityIdsTest
@coversDefaultClass \Drupal\fillpdf\Service\FillPdfLinkManipulator

Namespace

Drupal\Tests\fillpdf\Unit\LinkManipulator

Code

public function testEntityIds(array $input, array $expected) {

  // Parse query parameters, creating a context.
  $context = FillPdfLinkManipulator::parseEntityIds($input);

  // Turn the context back into query parameters.
  $actual = FillPdfLinkManipulator::prepareEntityIds($context);
  $this
    ->assertEquals($expected, $actual);
}