You are here

public function FilenameGeneratorTest::testGenerateCustomCallback in Entity Print 8.2

Test filename generation with a custom label callback.

File

tests/src/Kernel/FilenameGeneratorTest.php, line 82

Class

FilenameGeneratorTest
@coversDefaultClass \Drupal\entity_print\FilenameGenerator @group entity_print

Namespace

Drupal\Tests\entity_print\Kernel

Code

public function testGenerateCustomCallback() {
  $node = $this
    ->createNode([]);
  $this
    ->assertEquals($node
    ->label() . 'appended', $this->filenameGenerator
    ->generateFilename([
    $node,
  ], function ($entity) {
    return $entity
      ->label() . 'appended';
  }));
}