You are here

public function ParseBooleanFlagsTest::testBooleanFlags in FillPDF 8.4

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

Tests &sample=, &download= and &flatten= query parameters.

@covers ::parseBooleanFlags

@dataProvider providerTestBooleanFlags

File

tests/src/Unit/LinkManipulator/ParseBooleanFlagsTest.php, line 22

Class

ParseBooleanFlagsTest
@coversDefaultClass \Drupal\fillpdf\Service\FillPdfLinkManipulator

Namespace

Drupal\Tests\fillpdf\Unit\LinkManipulator

Code

public function testBooleanFlags($input, $expected) {
  $context = FillPdfLinkManipulator::parseBooleanFlags($this
    ->buildQuery($input));
  $this
    ->assertEquals(is_null($expected) ? FALSE : $expected, $context['sample']);
  $this
    ->assertEquals(is_null($expected) ? FALSE : $expected, $context['force_download']);
  $this
    ->assertEquals(is_null($expected) ? TRUE : $expected, $context['flatten']);
}