You are here

public function FilenameGeneratorTest::generateFilenameDataProvider in Entity Print 8.2

Get the data for testing filename generation.

Return value

array An array of data rows for testing filename generation.

File

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

Class

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

Namespace

Drupal\Tests\entity_print\Kernel

Code

public function generateFilenameDataProvider() {
  return [
    // $node_title, $expected_filename.
    [
      'Random Node Title',
      'Random Node Title',
    ],
    [
      'Title -=with special chars&*#',
      'Title with special chars',
    ],
    [
      'Title 5 with Nums 2',
      'Title 5 with Nums 2',
    ],
    [
      'Dußeldorf will be transliterated',
      'Dusseldorf will be transliterated',
    ],
    // Ensure invalid filenames get the default.
    [
      ' ',
      FilenameGeneratorInterface::DEFAULT_FILENAME,
    ],
  ];
}