You are here

public function EntityPrintTest::testGenerateMultipleFilename in Entity Print 8

Test multiple file generation.

@covers ::generateMultiFilename @dataProvider generateMultipleFilenameDataProvider

File

tests/src/Unit/EntityPrintTest.php, line 36

Class

EntityPrintTest
@coversDefaultClass \Drupal\entity_print\EntityPrintPdfBuilder @group entity_print

Namespace

Drupal\Tests\entity_print\Unit

Code

public function testGenerateMultipleFilename($entity_labels, $expected_filename) {
  $entities = [];
  foreach ($entity_labels as $entity_label) {
    $entities[] = $this
      ->getMockEntity($entity_label);
  }
  $pdf_builder = $this
    ->getMockPdfBuilder();
  $reflection = new \ReflectionClass($pdf_builder);
  $method = $reflection
    ->getMethod('generateMultiFilename');
  $method
    ->setAccessible(true);
  $this
    ->assertEquals($expected_filename, $method
    ->invoke($pdf_builder, $entities));
}