You are here

public function SanitizeNameTest::testSanitizeName in Transliterate filenames for uploads 8

Tests sanitize filename.

@dataProvider providerSanitizeName

Parameters

string $filename: The tested file name.

string $expected: The expected name of sanitized file.

File

tests/src/Unit/SanitizeNameTest.php, line 38

Class

SanitizeNameTest
@coversDefaultClass \Drupal\transliterate_filenames\SanitizeName @group transliterate_filenames

Namespace

Drupal\Tests\transliterate_filenames\Unit

Code

public function testSanitizeName($filename, $expected) {
  $sanitize_filename = \Drupal::service('transliterate_filenames.sanitize_name');
  $this
    ->assertEquals($expected, $sanitize_filename
    ->sanitizeFilename($filename));
}